|
Entropic 2.3.8
Local-first agentic inference engine
|
Qwen 3.6 MoE chat adapter. More...
#include </home/runner/work/entropic/entropic/src/inference/adapters/qwen36_adapter.h>


Public Member Functions | |
| std::string | chat_format () const override |
| Chat format: ChatML. | |
| ParseResult | parse_tool_calls (const std::string &content) const override |
| Parse XML function calls; fall back to tagged JSON. | |
| Message | format_tool_result (const ToolCall &tool_call, const std::string &result) const override |
Wrap tool result in <tool_response> tags. | |
| std::string | format_system_with_vision (const std::string &base_system, bool has_vision) const override |
| Append vision instructions to the system prompt when active. | |
| std::string | format_content_parts (const std::vector< ContentPart > &parts) const override |
| Format multimodal content parts (OpenAI-native). | |
| ChatAdapter (std::string tier_name, std::string identity_prompt) | |
| Construct adapter with tier identity. | |
Public Member Functions inherited from entropic::ChatAdapter | |
| ChatAdapter (std::string tier_name, std::string identity_prompt) | |
| Construct adapter with tier identity. | |
| std::string | format_system_prompt (const std::string &base_prompt, const std::vector< std::string > &tool_jsons) const |
| Assemble system prompt: identity + context + tools. | |
| bool | is_response_complete (const std::string &content, const std::vector< ToolCall > &tool_calls) const |
| Check if response represents task completion. | |
Protected Member Functions | |
| std::string | format_tools (const std::vector< std::string > &tool_jsons) const override |
Format tools as <tools>...</tools> with OpenAI function JSON. | |
Protected Member Functions inherited from entropic::ChatAdapter | |
| std::vector< ToolCall > | parse_tagged_tool_calls (const std::string &content) const |
| Parse <tool_call>JSON</tool_call> tagged blocks. | |
| std::vector< ToolCall > | parse_bare_json_tool_calls (const std::string &content) const |
| Parse bare JSON lines containing "name" key. | |
| std::string | extract_thinking (const std::string &content) const |
| Extract <think>...</think> content. | |
| std::string | strip_think_blocks (const std::string &content) const |
| Strip all <think>...</think> blocks from content. | |
| std::optional< ToolCall > | try_recover_json (const std::string &json_str) const |
| Attempt JSON recovery on malformed tool call string. | |
| std::optional< ToolCall > | parse_single_tool_call (const std::string &json_str) const |
| Parse a single JSON tool call string. | |
Additional Inherited Members | |
Protected Attributes inherited from entropic::ChatAdapter | |
| std::string | tier_name_ |
| Identity tier name. | |
| std::string | identity_prompt_ |
| Assembled identity prompt. | |
| std::unordered_set< std::string > | tool_prefixes_ |
| Known tool prefixes. | |
Qwen 3.6 MoE chat adapter.
Overrides: XML tool call parsing (qwen3_coder format), <tools> tag formatting, <tool_response> result wrapping, vision system prompt extension. Reuses base-class think-block handling.
Definition at line 55 of file qwen36_adapter.h.
|
inlineoverridevirtual |
Chat format: ChatML.
Implements entropic::ChatAdapter.
Definition at line 65 of file qwen36_adapter.h.
| entropic::ChatAdapter::ChatAdapter | ( | std::string | tier_name, |
| std::string | identity_prompt | ||
| ) |
Construct adapter with tier identity.
| tier_name | Identity tier (e.g. "eng", "lead"). |
| identity_prompt | Assembled identity prompt. |
| tier_name | Identity tier name. |
| identity_prompt | Assembled identity prompt. |
Definition at line 66 of file adapter_base.cpp.
|
overridevirtual |
Format multimodal content parts (OpenAI-native).
Format content parts using the OpenAI content-array convention.
Qwen 3.6 uses the same OpenAI content-array convention as Qwen 3.5 — early fusion, no special image tags.
| parts | Content parts from a message. |
| parts | Content parts from a message. |
Reimplemented from entropic::ChatAdapter.
Definition at line 283 of file qwen36_adapter.cpp.
|
overridevirtual |
Append vision instructions to the system prompt when active.
| base_system | Base system prompt text. |
| has_vision | Whether vision capability is available for the tier. |
| base_system | Base system prompt text. |
| has_vision | Whether vision is enabled for the tier. |
Reimplemented from entropic::ChatAdapter.
Definition at line 267 of file qwen36_adapter.cpp.
|
overridevirtual |
Wrap tool result in <tool_response> tags.
Wrap tool result in <tool_response> tags as a user message.
| tool_call | Executed tool call. |
| result | Execution result text. |
| tool_call | Executed tool call (name available for logging only). |
| result | Execution result text. |
Reimplemented from entropic::ChatAdapter.
Definition at line 176 of file qwen36_adapter.cpp.
|
overrideprotectedvirtual |
Format tools as <tools>...</tools> with OpenAI function JSON.
Format tool definitions as a <tools> JSON array section.
| tool_jsons | Tool definition JSON strings. |
Matches Qwen's qwen3_coder template expectations: a # Tools header, an OpenAI-function-formatted JSON array inside <tools> tags, then the call-format reminder.
| tool_jsons | Tool definition JSON strings. |
Reimplemented from entropic::ChatAdapter.
Definition at line 201 of file qwen36_adapter.cpp.
|
overridevirtual |
Parse XML function calls; fall back to tagged JSON.
Parse tool calls from Qwen 3.6 output.
| content | Raw model output. |
Primary path: XML function calls (qwen3_coder format). Fallback: tagged JSON via the base class — covers stray <tool_call>{...}</tool_call> outputs.
| content | Raw model output. |
Implements entropic::ChatAdapter.
Definition at line 66 of file qwen36_adapter.cpp.