Skip to main content

Module util

Module util 

Source
Expand description

Shared conversion utilities used by both streaming and non-streaming paths.

Functionsยง

extract_queries_from_arguments
Extract query/queries from JSON arguments string.
find_pattern
Find a pattern in char array starting from pos.
map_tool_name_to_output_type
Map a tool name to its OutputItemType using the original tools list.
map_tool_name_to_stream_item_type
Map a tool name to its stream item type string using request context.
parse_streaming_thinking
Parse thinking tags from streaming content.
parse_thought_tags
Parse thinking tags from a complete text string (non-streaming).
sanitize_pseudo_tool_markup
Escape pseudo XML tool tags that some upstream models emit as plain text.