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
OutputItemTypeusing 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.