Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjoyo committed Sep 22, 2023
1 parent e3c7a87 commit e83578e
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion python/src/gpt/agents/retrieval_agent/retrieval_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def json_schema_to_pydantic_model(name: str, schema: Dict[str, Any]) -> Any:
def create_retrieval_agent(
llm: BaseChatModel,
vector_store: VectorStore,
filter_llm: BaseChatModel = ChatOpenAI(temperature=0),
filter_llm: BaseChatModel,
summary_store: Optional[VectorStore] = None,
output_schema: Optional[Dict[str, Union[str, dict]]] = None,
multi_query_expansion: bool = False,
Expand Down
1 change: 1 addition & 0 deletions python/src/gpt/server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ async def post(task: RetrievalTask):
summary_store = None
agent = create_retrieval_agent(
llm=model_id_to_llm(task.model),
filter_llm=model_id_to_llm(task.model),
vector_store=vector_store,
output_schema=task.output_schema,
reranker=task.reranker,
Expand Down
1 change: 1 addition & 0 deletions python/tests/manual_integration/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ def test_retrieve():

qa = create_retrieval_agent(
llm=ChatOpenAI(model_name="gpt-4", temperature=0),
filter_llm=ChatOpenAI(model_name="gpt-4", temperature=0),
vector_store=vector_store,
multi_query_expansion=False,
# metadata_field_info=[
Expand Down
1 change: 1 addition & 0 deletions python/tests/server/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ def test_retrieval(agent_function_mock):

agent_function_mock.assert_called_with(
llm=None,
filter_llm=None,
vector_store=None,
output_schema={'result': 'the result'},
reranker='test_reranker',
Expand Down
3 changes: 2 additions & 1 deletion python/tests/test_ui/agent_retrieval.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@
)

agent = create_retrieval_agent(
llm=ChatOpenAI(model="gpt-4", streaming=True),
llm=ChatOpenAI(model="gpt-4", streaming=True, temperature=0),
filter_llm=ChatOpenAI(model="gpt-4", temperature=0),
vector_store=vector_store,
parent_document_store=parent_document_store,
summary_store=summary_store,
Expand Down

0 comments on commit e83578e

Please sign in to comment.