Skip to content

Commit ece4933

Browse files
committed
Remove agent if without serpapi
1. when the agent added, the performance of docGPT always not good 2. therefore, if the user just need ask question about document, and no need use serpapi, we'll use docGPT only
1 parent d2850de commit ece4933

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

docGPT/__init__.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,16 @@ def create_doc_gpt(docs):
4444
if SerpAPI.is_valid():
4545
search_tool = agent_.get_searp_chain
4646

47-
tools = [
48-
docGPT_tool,
49-
search_tool,
50-
# llm_tool, # This will cause agent confuse
51-
calculate_tool
52-
]
53-
agent_.initialize(tools)
54-
return agent_ if agent_ is not None else None
47+
tools = [
48+
docGPT_tool,
49+
search_tool,
50+
# llm_tool, # This will cause agent confuse
51+
calculate_tool
52+
]
53+
agent_.initialize(tools)
54+
return agent_ if agent_ is not None else None
55+
else:
56+
return docGPT
5557
else:
5658
# Use gpt4free llm model without agent
5759
llm_model = GPT4Free(

0 commit comments

Comments
 (0)