mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-07-18 21:21:11 +02:00
fixed web search
This commit is contained in:
parent
ef378ba802
commit
3d4702c83e
2 changed files with 21 additions and 3 deletions
|
|
@ -11,7 +11,9 @@ export const WorkflowAgent = z.object({
|
||||||
instructions: z.string(),
|
instructions: z.string(),
|
||||||
examples: z.string().optional(),
|
examples: z.string().optional(),
|
||||||
model: z.union([
|
model: z.union([
|
||||||
|
z.literal('gpt-4.1'),
|
||||||
z.literal('gpt-4o'),
|
z.literal('gpt-4o'),
|
||||||
|
z.literal('gpt-4.1-mini'),
|
||||||
z.literal('gpt-4o-mini'),
|
z.literal('gpt-4o-mini'),
|
||||||
]),
|
]),
|
||||||
locked: z.boolean().default(false).describe('Whether this agent is locked and cannot be deleted').optional(),
|
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;
|
return false;
|
||||||
})
|
})
|
||||||
|
|
||||||
// sanitize text
|
// sanitize text
|
||||||
for (const entity of entities) {
|
for (const entity of entities) {
|
||||||
const id = `${entity.type}:${entity.name}`;
|
const id = `${entity.type}:${entity.name}`;
|
||||||
|
|
|
||||||
|
|
@ -403,6 +403,21 @@ async def run_turn_streamed(
|
||||||
'tool_name': None,
|
'tool_name': None,
|
||||||
'response_type': 'internal'
|
'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:
|
else:
|
||||||
# Handle normal tool calls
|
# Handle normal tool calls
|
||||||
message = {
|
message = {
|
||||||
|
|
@ -421,8 +436,9 @@ async def run_turn_streamed(
|
||||||
'tool_name': None,
|
'tool_name': None,
|
||||||
'response_type': 'internal'
|
'response_type': 'internal'
|
||||||
}
|
}
|
||||||
print("Yielding message: ", message)
|
print("Yielding message: ", message)
|
||||||
yield ('message', message)
|
yield ('message', message)
|
||||||
|
|
||||||
|
|
||||||
elif event.item.type == "tool_call_output_item":
|
elif event.item.type == "tool_call_output_item":
|
||||||
# Check if it's a web search result
|
# Check if it's a web search result
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue