mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-23 20:21:03 +02:00
Agent messaging unit & contract tests
This commit is contained in:
parent
45ff3fa162
commit
91f798402f
2 changed files with 5 additions and 5 deletions
|
|
@ -39,7 +39,7 @@ class TestAgentServiceNonStreaming:
|
|||
async def mock_react(question, history, think, observe, answer, context, streaming):
|
||||
await think("I need to solve this.", is_final=True)
|
||||
await observe("The answer is 4.", is_final=True)
|
||||
return Final("4")
|
||||
return Final(thought="Final answer", final="4")
|
||||
|
||||
mock_agent_instance.react = mock_react
|
||||
|
||||
|
|
@ -115,7 +115,7 @@ class TestAgentServiceNonStreaming:
|
|||
|
||||
# Mock react to return Final directly
|
||||
async def mock_react(question, history, think, observe, answer, context, streaming):
|
||||
return Final("4")
|
||||
return Final(thought="Final answer", final="4")
|
||||
|
||||
mock_agent_instance.react = mock_react
|
||||
|
||||
|
|
|
|||
|
|
@ -48,13 +48,13 @@ class AgentService(FlowProcessor):
|
|||
|
||||
async def on_request(self, msg, consumer, flow):
|
||||
|
||||
# Get ID early so error handler can use it
|
||||
id = msg.properties().get("id", "unknown")
|
||||
|
||||
try:
|
||||
|
||||
request = msg.value()
|
||||
|
||||
# Sender-produced ID
|
||||
id = msg.properties()["id"]
|
||||
|
||||
async def respond(resp):
|
||||
|
||||
await flow("response").send(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue