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
ba3dc8ca
Unverified
Commit
ba3dc8ca
authored
Jul 27, 2023
by
John Wang
Committed by
GitHub
Jul 27, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: fix dataset retrieve agent llm not support error (#656)
parent
ae7c0380
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
2 deletions
+12
-2
multi_dataset_router_agent.py
api/core/agent/agent/multi_dataset_router_agent.py
+0
-1
agent_executor.py
api/core/agent/agent_executor.py
+2
-1
orchestrator_rule_parser.py
api/core/orchestrator_rule_parser.py
+10
-0
No files found.
api/core/agent/agent/multi_dataset_router_agent.py
View file @
ba3dc8ca
...
...
@@ -73,7 +73,6 @@ class MultiDatasetRouterAgent(OpenAIFunctionsAgent):
),
**
kwargs
:
Any
,
)
->
BaseSingleActionAgent
:
llm
.
model_name
=
'gpt-3.5-turbo'
return
super
()
.
from_llm_and_tools
(
llm
=
llm
,
tools
=
tools
,
...
...
api/core/agent/agent_executor.py
View file @
ba3dc8ca
...
...
@@ -31,6 +31,7 @@ class AgentConfiguration(BaseModel):
llm
:
BaseLanguageModel
tools
:
list
[
BaseTool
]
summary_llm
:
BaseLanguageModel
dataset_llm
:
BaseLanguageModel
memory
:
Optional
[
BaseChatMemory
]
=
None
callbacks
:
Callbacks
=
None
max_iterations
:
int
=
6
...
...
@@ -84,7 +85,7 @@ class AgentExecutor:
elif
self
.
configuration
.
strategy
==
PlanningStrategy
.
ROUTER
:
self
.
configuration
.
tools
=
[
t
for
t
in
self
.
configuration
.
tools
if
isinstance
(
t
,
DatasetRetrieverTool
)]
agent
=
MultiDatasetRouterAgent
.
from_llm_and_tools
(
llm
=
self
.
configuration
.
llm
,
llm
=
self
.
configuration
.
dataset_
llm
,
tools
=
self
.
configuration
.
tools
,
extra_prompt_messages
=
self
.
configuration
.
memory
.
buffer
if
self
.
configuration
.
memory
else
None
,
verbose
=
True
...
...
api/core/orchestrator_rule_parser.py
View file @
ba3dc8ca
...
...
@@ -32,6 +32,7 @@ class OrchestratorRuleParser:
self
.
tenant_id
=
tenant_id
self
.
app_model_config
=
app_model_config
self
.
agent_summary_model_name
=
"gpt-3.5-turbo-16k"
self
.
dataset_retrieve_model_name
=
"gpt-3.5-turbo"
def
to_agent_executor
(
self
,
conversation_message_task
:
ConversationMessageTask
,
memory
:
Optional
[
BaseChatMemory
],
rest_tokens
:
int
,
chain_callback
:
MainChainGatherCallbackHandler
)
\
...
...
@@ -89,11 +90,20 @@ class OrchestratorRuleParser:
if
len
(
tools
)
==
0
:
return
None
dataset_llm
=
LLMBuilder
.
to_llm
(
tenant_id
=
self
.
tenant_id
,
model_name
=
self
.
dataset_retrieve_model_name
,
temperature
=
0
,
max_tokens
=
500
,
callbacks
=
[
DifyStdOutCallbackHandler
()]
)
agent_configuration
=
AgentConfiguration
(
strategy
=
planning_strategy
,
llm
=
agent_llm
,
tools
=
tools
,
summary_llm
=
summary_llm
,
dataset_llm
=
dataset_llm
,
memory
=
memory
,
callbacks
=
[
chain_callback
,
agent_callback
],
max_iterations
=
10
,
...
...
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