|
Entropic 2.3.8
Local-first agentic inference engine
|
Gemma 4 chat adapter (covers A4B / E4B / E2B variants). More...
#include </home/runner/work/entropic/entropic/src/inference/adapters/gemma4_adapter.h>


Public Member Functions | |
| std::string | chat_format () const override |
| Chat format: GGUF-embedded template. | |
| ParseResult | parse_tool_calls (const std::string &content) const override |
| Parse tool calls via tagged JSON, falling back to bare JSON. | |
| 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. | |
| 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::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. | |
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. | |
Gemma 4 chat adapter (covers A4B / E4B / E2B variants).
Uses the GGUF-embedded chat template via chat_format()="" and a permissive multi-format tool-call parser pending empirical verification.
Definition at line 62 of file gemma4_adapter.h.
|
inlineoverridevirtual |
Chat format: GGUF-embedded template.
Implements entropic::ChatAdapter.
Definition at line 72 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 66 of file adapter_base.cpp.
|
overridevirtual |
Parse tool calls via tagged JSON, falling back to bare JSON.
Parse tool calls from Gemma 4 output.
Permissive strategy pending empirical confirmation of Gemma 4's native tool-call syntax. Strips <think> blocks from content.
| content | Raw model output. |
Tries tagged JSON first (<tool_call>{...}</tool_call> and the asymmetric <|tool_call> / <|im_start|>tool_call channel variants the base parser now accepts), then bare-JSON lines as a fallback. The base class handles malformed JSON recovery transparently when either path is exercised.
| content | Raw model output. |
Implements entropic::ChatAdapter.
Definition at line 35 of file gemma4_adapter.cpp.