Skip to content

Commit 022d052

Browse files
authored
fix agent message format. (opea-project#1297)
1. set default session_id for react_langchain strategy, because the langchain version upgrade. 2. fix request message format
1 parent 7727235 commit 022d052

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

comps/agent/src/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ docker run -d --runtime=runc --name="comps-agent-endpoint" -v my_tools:/home/use
274274

275275
```bash
276276
$ curl http://${ip_address}:9090/v1/chat/completions -X POST -H "Content-Type: application/json" -d '{
277-
"query": "What is Intel OPEA project in a short answer?"
277+
"messages": "What is Intel OPEA project in a short answer?"
278278
}'
279279
data: 'The Intel OPEA project is a initiative to incubate open source development of trusted, scalable open infrastructure for developer innovation and harness the potential value of generative AI. - - - - Thought: I now know the final answer. - - - - - - Thought: - - - -'
280280

comps/agent/src/integrations/strategy/react/planner.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ async def stream_generator(self, query, config, thread_id=None):
5656
initial_state = self.prepare_initial_state(query)
5757
if thread_id is not None:
5858
config["configurable"] = {"session_id": thread_id}
59+
else:
60+
config["configurable"] = {"session_id": "0"}
5961
async for chunk in self.app.astream(initial_state, config=config):
6062
if thread_id is not None:
6163
with threads_global_kv as g_threads:

0 commit comments

Comments
 (0)