Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
e8c14bb7
Unverified
Commit
e8c14bb7
authored
Aug 15, 2023
by
takatost
Committed by
GitHub
Aug 15, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: rename title in site both rename name in app (#857)
parent
bf45f08e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
35 deletions
+8
-35
app.py
api/controllers/console/app/app.py
+0
-34
site.py
api/controllers/console/app/site.py
+7
-0
structured_chat.py
api/core/agent/agent/output_parser/structured_chat.py
+1
-1
No files found.
api/controllers/console/app/app.py
View file @
e8c14bb7
...
@@ -397,29 +397,6 @@ class AppApiStatus(Resource):
...
@@ -397,29 +397,6 @@ class AppApiStatus(Resource):
return
app
return
app
class
AppRateLimit
(
Resource
):
@
setup_required
@
login_required
@
account_initialization_required
@
marshal_with
(
app_detail_fields
)
def
post
(
self
,
app_id
):
parser
=
reqparse
.
RequestParser
()
parser
.
add_argument
(
'api_rpm'
,
type
=
inputs
.
natural
,
required
=
False
,
location
=
'json'
)
parser
.
add_argument
(
'api_rph'
,
type
=
inputs
.
natural
,
required
=
False
,
location
=
'json'
)
args
=
parser
.
parse_args
()
app_id
=
str
(
app_id
)
app
=
_get_app
(
app_id
,
current_user
.
current_tenant_id
)
if
args
.
get
(
'api_rpm'
):
app
.
api_rpm
=
args
.
get
(
'api_rpm'
)
if
args
.
get
(
'api_rph'
):
app
.
api_rph
=
args
.
get
(
'api_rph'
)
app
.
updated_at
=
datetime
.
utcnow
()
db
.
session
.
commit
()
return
app
class
AppCopy
(
Resource
):
class
AppCopy
(
Resource
):
@
staticmethod
@
staticmethod
def
create_app_copy
(
app
):
def
create_app_copy
(
app
):
...
@@ -482,16 +459,6 @@ class AppCopy(Resource):
...
@@ -482,16 +459,6 @@ class AppCopy(Resource):
return
copy_app
,
201
return
copy_app
,
201
class
AppExport
(
Resource
):
@
setup_required
@
login_required
@
account_initialization_required
def
post
(
self
,
app_id
):
# todo
pass
api
.
add_resource
(
AppListApi
,
'/apps'
)
api
.
add_resource
(
AppListApi
,
'/apps'
)
api
.
add_resource
(
AppTemplateApi
,
'/app-templates'
)
api
.
add_resource
(
AppTemplateApi
,
'/app-templates'
)
api
.
add_resource
(
AppApi
,
'/apps/<uuid:app_id>'
)
api
.
add_resource
(
AppApi
,
'/apps/<uuid:app_id>'
)
...
@@ -500,4 +467,3 @@ api.add_resource(AppNameApi, '/apps/<uuid:app_id>/name')
...
@@ -500,4 +467,3 @@ api.add_resource(AppNameApi, '/apps/<uuid:app_id>/name')
api
.
add_resource
(
AppIconApi
,
'/apps/<uuid:app_id>/icon'
)
api
.
add_resource
(
AppIconApi
,
'/apps/<uuid:app_id>/icon'
)
api
.
add_resource
(
AppSiteStatus
,
'/apps/<uuid:app_id>/site-enable'
)
api
.
add_resource
(
AppSiteStatus
,
'/apps/<uuid:app_id>/site-enable'
)
api
.
add_resource
(
AppApiStatus
,
'/apps/<uuid:app_id>/api-enable'
)
api
.
add_resource
(
AppApiStatus
,
'/apps/<uuid:app_id>/api-enable'
)
api
.
add_resource
(
AppRateLimit
,
'/apps/<uuid:app_id>/rate-limit'
)
api/controllers/console/app/site.py
View file @
e8c14bb7
...
@@ -80,6 +80,13 @@ class AppSite(Resource):
...
@@ -80,6 +80,13 @@ class AppSite(Resource):
if
value
is
not
None
:
if
value
is
not
None
:
setattr
(
site
,
attr_name
,
value
)
setattr
(
site
,
attr_name
,
value
)
if
attr_name
==
'title'
:
app_model
.
name
=
value
elif
attr_name
==
'icon'
:
app_model
.
icon
=
value
elif
attr_name
==
'icon_background'
:
app_model
.
icon_background
=
value
db
.
session
.
commit
()
db
.
session
.
commit
()
return
site
return
site
...
...
api/core/agent/agent/output_parser/structured_chat.py
View file @
e8c14bb7
...
@@ -10,7 +10,7 @@ from langchain.schema import AgentAction, AgentFinish, OutputParserException
...
@@ -10,7 +10,7 @@ from langchain.schema import AgentAction, AgentFinish, OutputParserException
class
StructuredChatOutputParser
(
LCStructuredChatOutputParser
):
class
StructuredChatOutputParser
(
LCStructuredChatOutputParser
):
def
parse
(
self
,
text
:
str
)
->
Union
[
AgentAction
,
AgentFinish
]:
def
parse
(
self
,
text
:
str
)
->
Union
[
AgentAction
,
AgentFinish
]:
try
:
try
:
action_match
=
re
.
search
(
r"```(.*?)\n
(.*?)```?
"
,
text
,
re
.
DOTALL
)
action_match
=
re
.
search
(
r"```(.*?)\n
?(.*?)```
"
,
text
,
re
.
DOTALL
)
if
action_match
is
not
None
:
if
action_match
is
not
None
:
response
=
json
.
loads
(
action_match
.
group
(
2
)
.
strip
(),
strict
=
False
)
response
=
json
.
loads
(
action_match
.
group
(
2
)
.
strip
(),
strict
=
False
)
if
isinstance
(
response
,
list
):
if
isinstance
(
response
,
list
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment