| 2052 | static bool agent_bytes_partial_prefix_at(const char *p, const char *end, |
| 2053 | const char *prefix) { |
| 2054 | return bytes_is_partial_prefix(p, (size_t)(end - p), prefix); |
| 2055 | } |
| 2056 | |
| 2057 | static void agent_glm_tool_parse(agent_dsml_parser *p) { |
| 2058 | static const char start[] = "<tool_call>"; |
| 2059 | static const char close[] = "</tool_call>"; |
| 2060 | static const char arg_key[] = "<arg_key>"; |
| 2061 | static const char arg_key_close[] = "</arg_key>"; |
| 2062 | static const char arg_value[] = "<arg_value>"; |
| 2063 | static const char arg_value_close[] = "</arg_value>"; |
| 2064 | |
| 2065 | if (p->raw_len < sizeof(start) - 1 || |
| 2066 | memcmp(p->raw, start, sizeof(start) - 1) != 0) { |
| 2067 | return; |
| 2068 | } |
| 2069 | |
| 2070 | while (p->state == AGENT_DSML_STRUCTURAL || |
| 2071 | p->state == AGENT_DSML_PARAM_VALUE) |
no test coverage detected