Skip to content

Commit

Permalink
fix: retriever_resource missing (#1317)
Browse files Browse the repository at this point in the history
  • Loading branch information
takatost authored Oct 11, 2023
1 parent cbf0954 commit 9cba1c8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion api/core/orchestrator_rule_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,13 @@ def __init__(self, tenant_id: str, app_model_config: AppModelConfig):

def to_agent_executor(self, conversation_message_task: ConversationMessageTask, memory: Optional[BaseChatMemory],
rest_tokens: int, chain_callback: MainChainGatherCallbackHandler,
return_resource: bool = False, retriever_from: str = 'dev') -> Optional[AgentExecutor]:
retriever_from: str = 'dev') -> Optional[AgentExecutor]:
if not self.app_model_config.agent_mode_dict:
return None

agent_mode_config = self.app_model_config.agent_mode_dict
model_dict = self.app_model_config.model_dict
return_resource = self.app_model_config.retriever_resource_dict.get('enabled', False)

chain = None
if agent_mode_config and agent_mode_config.get('enabled'):
Expand Down
2 changes: 1 addition & 1 deletion api/core/tool/dataset_retriever_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class DatasetRetrieverTool(BaseTool):
dataset_id: str
k: int = 3
conversation_message_task: ConversationMessageTask
return_resource: str
return_resource: bool
retriever_from: str

@classmethod
Expand Down
3 changes: 2 additions & 1 deletion api/models/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ def copy(self):
user_input_form=self.user_input_form,
dataset_query_variable=self.dataset_query_variable,
pre_prompt=self.pre_prompt,
agent_mode=self.agent_mode
agent_mode=self.agent_mode,
retriever_resource=self.retriever_resource
)

return new_app_model_config
Expand Down

0 comments on commit 9cba1c8

Please sign in to comment.