|
Entropic 2.11.1
Local-first agentic inference engine
|
Fallback adapter for Gemma-4 tiers; owns the <|channel> markers.
More...
#include </home/runner/work/entropic/entropic/src/inference/adapters/gemma4_adapter.h>


Public Member Functions | |
| std::string | chat_format () const override |
| Chat format identifier. | |
| ThinkMarkers | thinking_markers () const override |
| Gemma-4 QAT reasoning delimiters. | |
| ParseResult | parse_tool_calls (const std::string &content) const override |
| Fallback parse for when no common_chat arena is available. | |
| 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 | strip_think_blocks (const std::string &content) const |
| Strip this family's reasoning blocks from content (gh#108). | |
| virtual Message | format_tool_result (const ToolCall &tool_call, const std::string &result) const |
| Format a tool result as a user message. | |
| virtual std::string | format_tools (const std::vector< std::string > &tool_jsons) const |
| Format tool definitions for injection into system prompt. | |
| bool | is_response_complete (const std::string &content, const std::vector< ToolCall > &tool_calls) const |
| Check if response represents task completion. | |
| virtual std::string | format_system_with_vision (const std::string &base_system, bool has_vision) const |
| Format system prompt with optional vision context. | |
| virtual std::string | format_content_parts (const std::vector< ContentPart > &parts) const |
| Convert multimodal content parts to adapter-specific format. | |
Additional Inherited Members | |
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::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. | |
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. | |
Fallback adapter for Gemma-4 tiers; owns the <|channel> markers.
Definition at line 38 of file gemma4_adapter.h.
|
inlineoverridevirtual |
Chat format identifier.
Implements entropic::ChatAdapter.
Definition at line 48 of file gemma4_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 137 of file adapter_base.cpp.
|
overridevirtual |
Fallback parse for when no common_chat arena is available.
| content | Raw model output. |
Reasoning removal comes from the base marker-driven strip, which reads thinking_markers() — the whole reason this class exists.
For tool calls this reuses the base bare-JSON recovery rather than adding a hand-rolled Gemma grammar: PEG_GEMMA4 stays primary whenever a tooled render captured an arena, and a toolless call has no staged tools to invoke in the first place, so the realistic yield here is zero calls plus clean content. recover_action_envelope_calls still covers the gh#88 case where a primed model parrots a {"action":...} envelope.
| content | Raw model output. |
Implements entropic::ChatAdapter.
Definition at line 30 of file gemma4_adapter.cpp.
|
inlineoverridevirtual |
Gemma-4 QAT reasoning delimiters.
Note the close marker is <channel|>, not a mirrored </|channel> — matching the live emission and strip_thinking_channels, whose behaviour this consolidates.
Declared once here and read by both consumers: the buffered strip (ChatAdapter::strip_think_blocks) and the live StreamThinkFilter that wraps on_token in generate_streaming.
{"<|channel>", "<channel|>"}. @req REQ-INFER-011 Reimplemented from entropic::ChatAdapter.
Definition at line 65 of file gemma4_adapter.h.