fixed web search

This commit is contained in:
arkml 2025-04-15 17:49:56 +05:30 committed by Ramnique Singh
parent ef378ba802
commit 3d4702c83e
2 changed files with 21 additions and 3 deletions

View file

@ -11,7 +11,9 @@ export const WorkflowAgent = z.object({
instructions: z.string(),
examples: z.string().optional(),
model: z.union([
z.literal('gpt-4.1'),
z.literal('gpt-4o'),
z.literal('gpt-4.1-mini'),
z.literal('gpt-4o-mini'),
]),
locked: z.boolean().default(false).describe('Whether this agent is locked and cannot be deleted').optional(),
@ -124,7 +126,7 @@ export function sanitizeTextWithMentions(
}
return false;
})
// sanitize text
for (const entity of entities) {
const id = `${entity.type}:${entity.name}`;

View file

@ -403,6 +403,21 @@ async def run_turn_streamed(
'tool_name': None,
'response_type': 'internal'
}
print("Yielding message: ", message)
yield ('message', message)
result_message = {
'content': "Web search done",
'role': 'tool',
'sender': None,
'tool_calls': None,
'tool_call_id': call_id,
'tool_name': 'web_search',
'response_type': 'internal'
}
print("Yielding web search results: ", result_message)
yield ('message', result_message)
else:
# Handle normal tool calls
message = {
@ -421,8 +436,9 @@ async def run_turn_streamed(
'tool_name': None,
'response_type': 'internal'
}
print("Yielding message: ", message)
yield ('message', message)
print("Yielding message: ", message)
yield ('message', message)
elif event.item.type == "tool_call_output_item":
# Check if it's a web search result