easydel.inference.tools.parsers.hunyuan_a13b_tool_parser#

class easydel.inference.tools.parsers.hunyuan_a13b_tool_parser.HunyuanA13BToolParser(tokenizer: AutoTokenizer)[source]#

Bases: ToolParser

Tool parser for Hunyuan A13B model.

Handles tool calls wrapped in <tool_calls> tags with support for thinking tags. Parses JSON array format with special handling for Chinese language tokens (助手:).

Features: - Filters tool calls from thinking sections - Supports nested JSON in arguments - Handles streaming with state management - Regex-based extraction with JSON validation

Format: <tool_calls>[{“name”: “func”, “arguments”: {…}}]</tool_calls>

extract_tool_calls(model_output: str, request: ChatCompletionRequest) ExtractedToolCallInformation[source]#

Extract tool calls from a complete model output.

extract_tool_calls_streaming(previous_text: str, current_text: str, delta_text: str, previous_token_ids: Sequence[int], current_token_ids: Sequence[int], delta_token_ids: Sequence[int], request: ChatCompletionRequest) easydel.inference.openai_api_modules.DeltaMessage | None[source]#

Extract tool calls for streaming mode.

preprocess_model_output(model_output: str) tuple[str | None, str | None][source]#