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
a19473e2
Commit
a19473e2
authored
Mar 03, 2024
by
takatost
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use enum instead
parent
ab933a25
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
generate_task_pipeline.py
api/core/app/apps/advanced_chat/generate_task_pipeline.py
+3
-2
No files found.
api/core/app/apps/advanced_chat/generate_task_pipeline.py
View file @
a19473e2
...
...
@@ -30,6 +30,7 @@ from core.model_runtime.entities.llm_entities import LLMUsage
from
core.model_runtime.errors.invoke
import
InvokeAuthorizationError
,
InvokeError
from
core.moderation.output_moderation
import
ModerationRule
,
OutputModeration
from
core.tools.tool_file_manager
import
ToolFileManager
from
core.workflow.entities.NodeEntities
import
NodeType
from
events.message_event
import
message_was_created
from
extensions.ext_database
import
db
from
models.model
import
Conversation
,
Message
,
MessageFile
...
...
@@ -111,7 +112,7 @@ class AdvancedChatAppGenerateTaskPipeline:
elif
isinstance
(
event
,
QueueNodeFinishedEvent
):
workflow_node_execution
=
self
.
_get_workflow_node_execution
(
event
.
workflow_node_execution_id
)
if
workflow_node_execution
.
status
==
WorkflowNodeExecutionStatus
.
SUCCEEDED
.
value
:
if
workflow_node_execution
.
node_type
==
'llm'
:
# todo use enum
if
workflow_node_execution
.
node_type
==
NodeType
.
LLM
.
value
:
outputs
=
workflow_node_execution
.
outputs_dict
usage_dict
=
outputs
.
get
(
'usage'
,
{})
self
.
_task_state
.
metadata
[
'usage'
]
=
usage_dict
...
...
@@ -201,7 +202,7 @@ class AdvancedChatAppGenerateTaskPipeline:
elif
isinstance
(
event
,
QueueNodeFinishedEvent
):
workflow_node_execution
=
self
.
_get_workflow_node_execution
(
event
.
workflow_node_execution_id
)
if
workflow_node_execution
.
status
==
WorkflowNodeExecutionStatus
.
SUCCEEDED
.
value
:
if
workflow_node_execution
.
node_type
==
'llm'
:
# todo use enum
if
workflow_node_execution
.
node_type
==
NodeType
.
LLM
.
value
:
outputs
=
workflow_node_execution
.
outputs_dict
usage_dict
=
outputs
.
get
(
'usage'
,
{})
self
.
_task_state
.
metadata
[
'usage'
]
=
usage_dict
...
...
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