Skip to content

Commit e5c1cc9

Browse files
authored
Merge pull request #79 from pattern-tech/refactor/ai-v2
Adjust timeout values and update media type for streaming messages
2 parents 934036a + 2bfb8a6 commit e5c1cc9

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

src/agent/services/agent_service.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,9 @@ def __init__(self, tools, memory=None, streaming: bool = True):
146146
self.streaming_handler = None
147147

148148
# Default timeout values that can be adjusted if needed
149-
self.token_timeout = 0.5 # Increased from 0.01
150-
self.buffer_timeout = 0.1 # Increased from 0.005
151-
self.poll_interval = 0.1 # Increased from 0.01
149+
self.token_timeout = 0.2
150+
self.buffer_timeout = 0.05
151+
self.poll_interval = 0.1
152152

153153
# Set up the streaming callback if streaming is enabled.
154154
if streaming:

src/agentflow/providers/moralis_tools.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,3 +252,4 @@ def get_token_approvals(wallet_address: str, chain: str, output_include: list[st
252252

253253
return {"cursor": api_result.get("cursor", None),
254254
"results": final_results}
255+

src/conversation/routers/playground_conversation_router.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,13 @@ async def send_message(
426426
project_id,
427427
input.message_type,
428428
input.stream),
429-
media_type="text/plain"
429+
media_type="text/event-stream",
430+
headers={
431+
"Content-Type": "text/event-stream",
432+
"Cache-Control": "no-cache",
433+
"Connection": "keep-alive",
434+
"X-Accel-Buffering": "no",
435+
},
430436
)
431437
else:
432438
response = None

0 commit comments

Comments
 (0)