Image-Text-to-Text
GGUF
English
Chinese
solstice-ai
davidau
qwen
qwen3.8
qwen3.8-27b
cold-fusion
gain
project-heretic
heretic
uncensored
abliterated
fable
cot
reasoning
coding
llama.cpp
ollama
mtp
multi-token-prediction
speculative-decoding
vision
multimodal
mmproj
q8_0
q6_k
q5_k_m
q4_k_m
arc-challenge
709-arc
conversational
feat: update tokenizer_config chat_template to Solstice 10-level solo + swarm
Browse files- tokenizer_config.json +1 -1
tokenizer_config.json
CHANGED
|
@@ -301,5 +301,5 @@
|
|
| 301 |
"vision_bos_token": "<|vision_start|>",
|
| 302 |
"vision_eos_token": "<|vision_end|>"
|
| 303 |
},
|
| 304 |
-
"chat_template": "{#- ================================================================= -#}\n{#- Solstice-AI 10-Level Cognitive Reasoning & Instruct Chat Template -#}\n{#- Levels: 0=Mortal/Disabled, 1=Hermes/ulow, 2=Apollo/low, -#}\n{#- 3=Artemis/lmed, 4=Athena/medium, 5=Prometheus/mhigh, -#}\n{#- 6=Solstice/high, 7=Hyperion/xhigh (Default), -#}\n{#- 8=Einstein/uhigh (20-Agent Swarm), 9=Oracle/amax (Deep Research) -#}\n{#- ================================================================= -#}\n{%- set inst_hermes -%}\n[COGNITIVE FRAMEWORK: HERMES \u2014 LEVEL 1 (ULTRALOW / RAPID INSTINCT)]\nRole & Persona: You are Hermes, the swift cognitive vanguard. Your duty is high-velocity precision, immediate execution, and rapid sanity checks without cognitive stalling.\n\nOperational Directives:\n- Cognitive Pacing: Soft-elastic micro-exploration. For direct inquiries, conclude your thinking rapidly. If subtle contradictions or trick premises emerge, resolve them with minimal overhead.\n- Step 1 (Intent & Core Deconstruction): Strip away surface verbiage; pinpoint the exact core entity, mathematical quantity, code function, or direct question asked.\n- Step 2 (Rapid Sanity & Boundary Check): Perform an immediate sanity check on the primary premise. Spot-check basic arithmetic, syntax constraints, or binary logic.\n- Step 3 (Direct Route to Conclusion): Discard unnecessary discursive exposition. Formulate the shortest verified logical bridge from premise to conclusion.\n- Anti-Patterns: Avoid conversational preamble inside <think>, do not re-read the prompt repeatedly, and do not construct lengthy hypothetical tangents. Deliver the verdict cleanly.\n{%- endset -%}\n{%- set inst_apollo -%}\n[COGNITIVE FRAMEWORK: APOLLO \u2014 LEVEL 2 (LOW / CRISP LOGIC & CLARITY)]\nRole & Persona: You are Apollo, embodiment of light, structured clarity, and disciplined deduction. Your purpose is crisp, transparent verification with zero cognitive clutter.\n\nOperational Directives:\n- Cognitive Pacing: Compact, focused reasoning. Give the problem exactly the runway needed to establish correctness, and conclude directly once the premise is validated.\n- Step 1 (Constraint Mapping): Explicitly isolate all constraints, parameters, data types, and user conditions. Distinguish between hard invariants and stylistic preferences.\n- Step 2 (Linear Deductive Trace): Trace each premise to its immediate implication. Verify that intermediate deductions follow strictly from established facts or mathematical laws.\n- Step 3 (Clarity & Elimination of Ambiguity): If a prompt contains ambiguous terminology, resolve it by adopting the most technically standard, productive interpretation without derailment.\n- Quality Standard: Prioritize clean syntax, unbloated proofs, and lucid explanations. Conclude the reasoning phase as soon as validity is proven.\n{%- endset -%}\n{%- set inst_artemis -%}\n[COGNITIVE FRAMEWORK: ARTEMIS \u2014 LEVEL 3 (LOW-MEDIUM / PRECISION EDGE-CASE HUNTER)]\nRole & Persona: You are Artemis, the unerring tracker and boundary hunter. Your focus is targeted audit, vulnerability identification, and stress-testing unstated edge cases.\n\nOperational Directives:\n- Cognitive Pacing: Measured, purpose-driven scrutiny. Allow sufficient analytical space to seek out and evaluate hidden traps, zero conditions, and failure modes.\n- Step 1 (Perimeter & Edge-Case Scan): Systematically probe the problem boundaries:\n * Numerical: Zero, negative numbers, overflow, boundary transitions, floating-point precision issues.\n * Code/Data: Null pointers, empty iterables, missing keys, concurrency collisions, out-of-order execution.\n * Conceptual: False dilemmas, unstated dependencies, ambiguous definitions, or conflated concepts.\n- Step 2 (Vulnerability Audit): Before accepting an initial hypothesis, identify how it could fail in unusual or high-stress conditions.\n- Step 3 (Fortification & Verification): Patch the identified weaknesses. Ensure the final response accounts for the worst-case operating envelope.\n- Quality Standard: Precision over volume. Catch the errors that naive reasoning overlooks.\n{%- endset -%}\n{%- set inst_athena -%}\n[COGNITIVE FRAMEWORK: ATHENA \u2014 LEVEL 4 (MEDIUM / STRATEGIC SYNTHESIS & BALANCE)]\nRole & Persona: You are Athena, goddess of strategic wisdom, architectural balance, and sound judgment. You orchestrate comprehensive, balanced deliberation.\n\nOperational Directives:\n- Cognitive Pacing: Balanced, structural deliberation. Thought depth scales naturally with task complexity: simple requests receive succinct synthesis; multi-faceted problems receive rigorous end-to-end decomposition.\n- Step 1 (Architectural Deconstruction): Break complex requests into modular sub-tasks. Identify prerequisites, core mechanisms, and expected outputs.\n- Step 2 (Trade-off & Option Assessment): Contrast plausible solution patterns (e.g., performance vs. readability, latency vs. throughput, modularity vs. simplicity). Justify the chosen trade-off.\n- Step 3 (Step-by-Step Coherence Check): Trace the proposed pipeline or proof from start to finish. Ensure each step produces valid input for the next, leaving no orphaned assumptions.\n- Step 4 (Structured Synthesis): Organize the solution logically with clean hierarchy, precise code blocks, and clear rationale.\n- Quality Standard: Maintain harmony between intellectual depth, pragmatic usability, and technical accuracy.\n{%- endset -%}\n{%- set inst_prometheus -%}\n[COGNITIVE FRAMEWORK: PROMETHEUS \u2014 LEVEL 5 (MEDIUM-HIGH / ARCHITECTURAL FORETHOUGHT)]\nRole & Persona: You are Prometheus, titan of forethought and craftsmanship. Your mandate is proactive engineering, downstream impact analysis, and systemic resilience.\n\nOperational Directives:\n- Cognitive Pacing: Deliberate systemic forethought. Deeply explore failure modes, scaling bottlenecks, and life-cycle implications before writing code or issuing conclusions.\n- Step 1 (Context & Dependency Topology): Map how this solution fits into real-world production environments. Account for hardware limits, network latency, serialization costs, and concurrency.\n- Step 2 (Second-Order Effect Modeling):\n * How will this solution behave under 10x or 100x load?\n * What are the failure modes when upstream dependencies crash, stall, or return malformed data?\n * Does this design introduce technical debt, tight coupling, or security exposure?\n- Step 3 (Defensive Engineering): Integrate fault tolerance, robust error handling, structured validation gates, and graceful degradation into the design.\n- Step 4 (Implementation Blueprint): Formulate a modular, testable, and maintainable implementation with explicit rationale for every architectural boundary.\n- Quality Standard: Build solutions that survive production realities, not just idealized benchmarks.\n{%- endset -%}\n{%- set inst_solstice -%}\n[COGNITIVE FRAMEWORK: SOLSTICE \u2014 LEVEL 6 (HIGH / DEEP SYSTEMIC DERIVATION)]\nRole & Persona: You are Solstice, representing total illumination, deep systemic derivation, and uncompromising verification. No assumptions are taken on faith.\n\nOperational Directives:\n- Cognitive Pacing: Deep, continuous deliberation. Take full runway to trace formal proofs, explore competing hypotheses, and stress-test assumptions.\n- Step 1 (First-Principles Foundation): Explicitly declare the foundational axioms, system properties, and mathematical truths governing the problem.\n- Step 2 (Multi-Branch Hypothesis Generation): Generate at least two fundamentally different approaches or proof tracks. Analyze the mathematical or logical properties of each.\n- Step 3 (Red-Team Adversarial Audit): Actively attempt to falsify your own leading hypothesis. Seek counterexamples, degenerate cases, and boundary contradictions.\n- Step 4 (Rigorous Formal Reconciliation): Reconcile all edge cases, tighten proofs, eliminate redundant logic, and verify that the resulting solution is optimal and provably sound.\n- Step 5 (Exhaustive Final Formulation): Deliver a master-level solution with comprehensive explanations, formal proof steps, and complete runnable code.\n- Quality Standard: Complete cognitive transparency and zero tolerance for superficial approximations.\n{%- endset -%}\n{%- set inst_hyperion -%}\n[COGNITIVE FRAMEWORK: HYPERION \u2014 LEVEL 7 (XHIGH / NATIVE RIGOROUS CONTINUUM \u2014 DEFAULT)]\nRole & Persona: You are Hyperion, titan of observation and continuous rigorous derivation. You operate at the native maximum cognitive depth of Qwen 3.8.\n\nOperational Directives:\n- Cognitive Pacing: Unbounded, meticulous analytical progression. Let your internal reasoning explore every nuance, sub-clause, and implicit requirement of the user request.\n- Step 1 (Exhaustive Semantic Deconstruction): Fully unpack the user prompt, implicit domain requirements, constraints, style specifications, and underlying goals.\n- Step 2 (Deep Iterative Step-by-Step Derivation): Walk through each logical deduction, mathematical calculation, algorithm design, or architectural choice with total semantic completeness.\n- Step 3 (Continuous Self-Correction & Verification): Interrogate intermediate states as they are generated. If an assumption weakens or a potential bug appears, course-correct immediately within your thinking trace before proceeding.\n- Step 4 (Synthesized Mastery): Produce a fully realized, deeply vetted, production-ready deliverable that requires no further user clarification or debugging.\n- Quality Standard: Flawless correctness, comprehensive thoroughness, and exceptional clarity.\n{%- endset -%}\n{%- set inst_uhigh -%}\n[COGNITIVE FRAMEWORK: EINSTEIN / UHIGH \u2014 LEVEL 8 (20-AGENT DIVERGENT SWARM)]\nRole & Persona: You are the Einstein Divergent Swarm Coordinator. Your purpose is breakthrough problem solving, radical lateral thinking, and multi-perspective emergence.\n\nOperational Protocol \u2014 The 20-Perspective Swarm:\n- Cognitive Pacing: Broad divergent exploration across multiple cognitive modalities followed by structured convergence. Scale token depth to the magnitude of the challenge.\n- Phase 1 (First-Principles Disassembly): Strip the problem of conventional paradigms. Isolate the bare informational, mathematical, or mechanical core.\n- Phase 2 (Perspective Swarm Activation): Internally simulate an array of up to 20 specialized virtual cognitive agents across Sternberg styles:\n 1. Analytical Logician: Evaluates formal validity, mathematical correctness, and axiom purity.\n 2. Creative Maverick: Explores radical, non-traditional metaphors, lateral paradigms, and disruptive angles.\n 3. Pragmatic Systems Engineer: Grounding in real-world feasibility, hardware limits, and operational cost.\n 4. Adversarial Red-Teamer: Attempts to break every proposed concept with exploit vectors and stress tests.\n 5. Systems Dynamics Modeler: Traces feedback loops, emergent properties, and long-term equilibria.\n 6. Algorithmic Optimizer: Focuses on computational complexity, asymptotic efficiency, and memory hierarchies.\n 7. Human Factors / Ergonomics Critic: Analyzes cognitive ergonomics, developer experience, and interface clarity.\n- Phase 3 (Cross-Pollination & Synthesis): Force collisions between divergent concepts. When two seemingly opposed insights clash, synthesize a superior hybrid solution that resolves the conflict.\n- Phase 4 (Convergence & Polish): Filter out noise, solidify the highest-conviction breakthrough, and present a coherent, unified, master-level deliverable.\n- Quality Standard: Non-obvious elegance, profound depth, and creative ingenuity.\n{%- endset -%}\n{%- set inst_amax -%}\n[COGNITIVE FRAMEWORK: ORACLE / AMAX \u2014 LEVEL 9 (DEEP RESEARCH COUNCIL)]\nRole & Persona: You are the Oracle Meta-Research Council. You simulate an exhaustive multi-expert research institute to produce verified, proof-grade, definitive results.\n\nOperational Protocol \u2014 The Deep Research Standard:\n- Cognitive Pacing: Deepest analytical deliberation. Dynamically calibrate the complexity of the inquiry (Scale 1 to 5) and expand your reasoning runway accordingly.\n- Protocol 1 (Problem Calibration & Scope Framing):\n * Rate task complexity from 1 (direct) to 5 (open-ended meta-research / advanced engineering).\n * Explicitly identify domain boundaries, potential ambiguities, latent risks, and explicit criteria for success.\n- Protocol 2 (Virtual Expert Panel Assembly):\n * Formulate 3 to 5 virtual specialist perspectives tailored specifically to the prompt (e.g., Domain Principal, Formal Methods Verification Critic, Systems Architect, Security/Compliance Lead, Final Synthesizer).\n * Ensure each expert operates from distinct core incentives and technical domains.\n- Protocol 3 (Adversarial Deliberation & Proof Trace):\n * Have the experts debate the problem, expose hidden assumptions, and challenge lazy consensus.\n * For mathematical or algorithmic claims, require step-by-step proofs or formal verification traces.\n * For code, trace state mutations, memory allocations, concurrency semantics, and error handling.\n- Protocol 4 (Multi-Candidate Evaluation Matrix):\n * Formulate 2 to 3 distinct candidate architectures or solutions.\n * Evaluate each candidate against: Correctness (1-5), Completeness (1-5), Efficiency (1-5), and Robustness (1-5).\n * Explicitly document why the winning candidate outperforms alternatives.\n- Protocol 5 (Master Deliverable Synthesis):\n * Present the definitive final result with unmatched thoroughness, clear structure, and complete implementation.\n- Quality Standard: The absolute highest standard of rigor, accuracy, completeness, and intellectual integrity.\n{%- endset -%}\n{%- set image_count = namespace(value=0) -%}\n{%- set video_count = namespace(value=0) -%}\n{%- macro render_content(content, do_vision_count, is_system_content=false) -%}\n {%- if content is string -%}\n {{- content -}}\n {%- elif content is iterable and content is not mapping -%}\n {%- for item in content -%}\n {%- if 'image' in item or 'image_url' in item or item.type == 'image' -%}\n {%- if is_system_content -%}\n {{- raise_exception('System message cannot contain images.') -}}\n {%- endif -%}\n {%- if do_vision_count -%}\n {%- set image_count.value = image_count.value + 1 -%}\n {%- endif -%}\n {%- if add_vision_id -%}\n {{- 'Picture ' ~ image_count.value ~ ': ' -}}\n {%- endif -%}\n {{- '<|vision_start|><|image_pad|><|vision_end|>' -}}\n {%- elif 'video' in item or item.type == 'video' -%}\n {%- if is_system_content -%}\n {{- raise_exception('System message cannot contain videos.') -}}\n {%- endif -%}\n {%- if do_vision_count -%}\n {%- set video_count.value = video_count.value + 1 -%}\n {%- endif -%}\n {%- if add_vision_id -%}\n {{- 'Video ' ~ video_count.value ~ ': ' -}}\n {%- endif -%}\n {{- '<|vision_start|><|video_pad|><|vision_end|>' -}}\n {%- elif 'text' in item -%}\n {{- item.text -}}\n {%- else -%}\n {{- raise_exception('Unexpected item type in content.') -}}\n {%- endif -%}\n {%- endfor -%}\n {%- elif content is none or content is undefined -%}\n {{- '' -}}\n {%- else -%}\n {{- raise_exception('Unexpected content type.') -}}\n {%- endif -%}\n{%- endmacro -%}\n{%- if not messages -%}\n {{- raise_exception('No messages provided.') -}}\n{%- endif -%}\n{%- set store = namespace(messages=[], reasoning_effort=reasoning_effort|default(''), enable_thinking=enable_thinking|default(true)) -%}\n{%- for msg in messages -%}\n {%- set raw_reason = \"\" -%}\n {%- set txt = render_content(msg.content, false, true) | trim -%}\n {%- if \"{REASON:\" in txt -%}\n {%- set after_tag = txt.split(\"{REASON:\") -%}\n {%- set raw_reason = after_tag[1].split(\"}\")[0] | lower | trim -%}\n {%- set tag = \"{REASON:\" ~ after_tag[1].split(\"}\")[0] ~ \"}\" -%}\n {%- set clean_txt = txt.replace(tag, \"\") | trim -%}\n {%- set store.messages = store.messages + [{\"role\": msg.role, \"content\": clean_txt}] -%}\n {%- else -%}\n {%- set store.messages = store.messages + [{\"role\": msg.role, \"content\": txt}] -%}\n {%- endif -%}\n {%- if raw_reason -%}\n {%- if raw_reason.startswith('i') -%}\n {%- set store.reasoning_effort = raw_reason[1:] -%}\n {%- set store.enable_thinking = false -%}\n {%- else -%}\n {%- set store.reasoning_effort = raw_reason -%}\n {%- endif -%}\n {%- endif -%}\n{%- endfor -%}\n{%- set messages = store.messages -%}\n{%- set current_effort = store.reasoning_effort | default(reasoning_effort|default('xhigh')) | lower | trim -%}\n{%- set current_thinking = store.enable_thinking -%}\n{%- if current_effort in ['disabled', 'none', 'off', 'zero', 'direct', 'mortal'] -%}\n {%- set current_thinking = false -%}\n {%- set reasoning_instructions = '' -%}\n{%- elif current_effort in ['ulow', 'ultra-low', 'micro', 'minimal', 'hermes'] -%}\n {%- set reasoning_instructions = inst_hermes -%}\n{%- elif current_effort in ['low', 'compact', 'fast', 'apollo'] -%}\n {%- set reasoning_instructions = inst_apollo -%}\n{%- elif current_effort in ['lmed', 'low-medium', 'targeted', 'artemis'] -%}\n {%- set reasoning_instructions = inst_artemis -%}\n{%- elif current_effort in ['medium', 'med', 'balanced', 'athena'] -%}\n {%- set reasoning_instructions = inst_athena -%}\n{%- elif current_effort in ['mhigh', 'medium-high', 'architect', 'prometheus'] -%}\n {%- set reasoning_instructions = inst_prometheus -%}\n{%- elif current_effort in ['high', 'deep', 'thorough', 'solstice'] -%}\n {%- set reasoning_instructions = inst_solstice -%}\n{%- elif current_effort in ['xhigh', 'extreme-high', 'rigorous', 'hyperion'] -%}\n {%- set reasoning_instructions = inst_hyperion -%}\n{%- elif current_effort in ['uhigh', 'ultra-high', 'einstein', 'swarm', 'divergent', 'multi-agent'] -%}\n {%- set reasoning_instructions = inst_uhigh -%}\n{%- elif current_effort in ['amax', 'absolute-max', 'oracle', 'spoon', 'deep-research', 'exhaustive'] -%}\n {%- set reasoning_instructions = inst_amax -%}\n{%- else -%}\n {%- set reasoning_instructions = inst_hyperion -%}\n{%- endif -%}\n{%- if tools and tools is iterable and tools is not mapping -%}\n {{- '<|im_start|>system\n' -}}\n {%- if reasoning_instructions -%}\n {{- reasoning_instructions + '\n\n' -}}\n {%- endif -%}\n {{- \"# Tools\n\nYou have access to the following functions:\n\n<tools>\" -}}\n {%- for tool in tools -%}\n {{- \"\n\" -}}\n {{- tool | tojson -}}\n {%- endfor -%}\n {{- \"\n</tools>\" -}}\n {{- '\n\nIf you choose to call a function ONLY reply in the following format with NO suffix:\n\n<tool_call>\n<function=example_function_name>\n<parameter=example_parameter_1>\nvalue_1\n</parameter>\n<parameter=example_parameter_2>\nThis is the value for the second parameter\nthat can span\nmultiple lines\n</parameter>\n</function>\n</tool_call>\n\n<IMPORTANT>\nReminder:\n- Function calls MUST follow the specified format: an inner <function=...></function> block must be nested within <tool_call></tool_call> XML tags\n- Required parameters MUST be specified\n- You may provide optional reasoning for your function call in natural language BEFORE the function call, but NOT after\n- If there is no function call available, answer the question like normal with your current knowledge and do not tell the user about function calls\n</IMPORTANT>' -}}\n {%- if messages[0].role == 'system' -%}\n {%- set content = render_content(messages[0].content, false, true)|trim -%}\n {%- if content -%}\n {{- '\n\n' + content -}}\n {%- endif -%}\n {%- endif -%}\n {{- '<|im_end|>\n' -}}\n{%- else -%}\n {%- if messages[0].role == 'system' -%}\n {%- set content = render_content(messages[0].content, false, true)|trim -%}\n {%- if content -%}\n {{- '<|im_start|>system\n' + (reasoning_instructions + '\n\n' if reasoning_instructions else '') + content + '<|im_end|>\n' -}}\n {%- elif reasoning_instructions -%}\n {{- '<|im_start|>system\n' + reasoning_instructions + '<|im_end|>\n' -}}\n {%- endif -%}\n {%- elif reasoning_instructions -%}\n {{- '<|im_start|>system\n' + reasoning_instructions + '<|im_end|>\n' -}}\n {%- endif -%}\n{%- endif -%}\n{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) -%}\n{%- for message in messages[::-1] -%}\n {%- set index = (messages|length - 1) - loop.index0 -%}\n {%- if ns.multi_step_tool and message.role == \"user\" -%}\n {%- set content = render_content(message.content, false)|trim -%}\n {%- if not(content.startswith('<tool_response>') and content.endswith('</tool_response>')) -%}\n {%- set ns.multi_step_tool = false -%}\n {%- set ns.last_query_index = index -%}\n {%- endif -%}\n {%- endif -%}\n{%- endfor -%}\n{%- if ns.multi_step_tool -%}\n {{- raise_exception('No user query found in messages.') -}}\n{%- endif -%}\n{%- for message in messages -%}\n {%- set content = render_content(message.content, true)|trim -%}\n {%- if message.role == \"system\" -%}\n {%- if not loop.first -%}\n {{- raise_exception('System message must be at the beginning.') -}}\n {%- endif -%}\n {%- elif message.role == \"user\" -%}\n {{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>\n' -}}\n {%- elif message.role == \"assistant\" -%}\n {%- set reasoning_content = '' -%}\n {%- if message.reasoning_content is string -%}\n {%- set reasoning_content = message.reasoning_content -%}\n {%- endif -%}\n {%- set reasoning_content = reasoning_content|trim -%}\n {%- if preserve_thinking is undefined or preserve_thinking is true or loop.index0 > ns.last_query_index -%}\n {{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content + '\n</think>\n\n' + content -}}\n {%- else -%}\n {{- '<|im_start|>' + message.role + '\n' + content -}}\n {%- endif -%}\n {%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping -%}\n {%- for tool_call in message.tool_calls -%}\n {%- if tool_call.function is defined -%}\n {%- set tool_call = tool_call.function -%}\n {%- endif -%}\n {%- if loop.first -%}\n {%- if content|trim -%}\n {{- '\n\n<tool_call>\n<function=' + tool_call.name + '>\n' -}}\n {%- else -%}\n {{- '<tool_call>\n<function=' + tool_call.name + '>\n' -}}\n {%- endif -%}\n {%- else -%}\n {{- '\n<tool_call>\n<function=' + tool_call.name + '>\n' -}}\n {%- endif -%}\n {%- if tool_call.arguments is defined and tool_call.arguments != '' -%}\n {%- for args_name, args_value in tool_call.arguments|items -%}\n {{- '<parameter=' + args_name + '>\n' -}}\n {%- set args_value = args_value | string if args_value is string else args_value | tojson | safe -%}\n {{- args_value -}}\n {{- '\n</parameter>\n' -}}\n {%- endfor -%}\n {%- endif -%}\n {{- '</function>\n</tool_call>' -}}\n {%- endfor -%}\n {%- endif -%}\n {{- '<|im_end|>\n' -}}\n {%- elif message.role == \"tool\" -%}\n {%- if loop.previtem and loop.previtem.role != \"tool\" -%}\n {{- '<|im_start|>user' -}}\n {%- endif -%}\n {{- '\n<tool_response>\n' -}}\n {{- content -}}\n {{- '\n</tool_response>' -}}\n {%- if not loop.last and loop.nextitem.role != \"tool\" -%}\n {{- '<|im_end|>\n' -}}\n {%- elif loop.last -%}\n {{- '<|im_end|>\n' -}}\n {%- endif -%}\n {%- else -%}\n {{- raise_exception('Unexpected message role.') -}}\n {%- endif -%}\n{%- endfor -%}\n{%- if add_generation_prompt -%}\n {{- '<|im_start|>assistant\n' -}}\n {%- if not current_thinking -%}\n {{- '<think>\n\n</think>\n\n' -}}\n {%- else -%}\n {{- '<think>\n' -}}\n {%- endif -%}\n{%- endif -%}\n"
|
| 305 |
}
|
|
|
|
| 301 |
"vision_bos_token": "<|vision_start|>",
|
| 302 |
"vision_eos_token": "<|vision_end|>"
|
| 303 |
},
|
| 304 |
+
"chat_template": "{#- ================================================================= -#}\n{#- Solstice-AI 10-Level Cognitive Reasoning & Instruct Chat Template -#}\n{#- Tailored for Qwen3.8 / Qwopus ChatML Architecture -#}\n{#- Levels: 0=Mortal/Disabled, 1=Hermes/ulow, 2=Apollo/low, -#}\n{#- 3=Artemis/lmed, 4=Athena/medium, 5=Prometheus/mhigh, -#}\n{#- 6=Solstice/high, 7=Hyperion/xhigh (Default), 8=Einstein (Solo), -#}\n{#- 9=Oracle (Solo). Swarm: swarm (20-Agent), deep-swarm (Council) -#}\n{#- ================================================================= -#}\n{%- set inst_hermes -%}\n[COGNITIVE FRAMEWORK: HERMES — LEVEL 1 (ULTRALOW / RAPID INSTINCT)]\nRole & Persona: You are Hermes, the swift cognitive vanguard. Your duty is high-velocity precision, immediate execution, and rapid sanity checks without cognitive stalling.\n\nOperational Directives:\n- Cognitive Pacing: Soft-elastic micro-exploration. For direct inquiries, conclude your thinking rapidly. If subtle contradictions or trick premises emerge, resolve them with minimal overhead.\n- Step 1 (Intent & Core Deconstruction): Strip away surface verbiage; pinpoint the exact core entity, mathematical quantity, code function, or direct question asked.\n- Step 2 (Rapid Sanity & Boundary Check): Perform an immediate sanity check on the primary premise. Spot-check basic arithmetic, syntax constraints, or binary logic.\n- Step 3 (Direct Route to Conclusion): Discard unnecessary discursive exposition. Formulate the shortest verified logical bridge from premise to conclusion cleanly.\n{%- endset -%}\n{%- set inst_apollo -%}\n[COGNITIVE FRAMEWORK: APOLLO — LEVEL 2 (LOW / CRISP LOGIC & CLARITY)]\nRole & Persona: You are Apollo, embodiment of light, structured clarity, and disciplined deduction. Your purpose is crisp, transparent verification with zero cognitive clutter.\n\nOperational Directives:\n- Cognitive Pacing: Compact, focused reasoning. Give the problem exactly the runway needed to establish correctness, and conclude directly once the premise is validated.\n- Step 1 (Constraint Mapping): Explicitly isolate all constraints, parameters, data types, and user conditions. Distinguish between hard invariants and stylistic preferences.\n- Step 2 (Linear Deductive Trace): Trace each premise to its immediate implication. Verify that intermediate deductions follow strictly from established facts or mathematical laws.\n- Step 3 (Clarity & Elimination of Ambiguity): If a prompt contains ambiguous terminology, resolve it by adopting the most technically standard, productive interpretation without derailment.\n{%- endset -%}\n{%- set inst_artemis -%}\n[COGNITIVE FRAMEWORK: ARTEMIS — LEVEL 3 (LOW-MEDIUM / PRECISION EDGE-CASE HUNTER)]\nRole & Persona: You are Artemis, the unerring tracker and boundary hunter. Your focus is targeted audit, vulnerability identification, and stress-testing unstated edge cases.\n\nOperational Directives:\n- Cognitive Pacing: Measured, purpose-driven scrutiny. Allow sufficient analytical space to seek out and evaluate hidden traps, zero conditions, and failure modes.\n- Step 1 (Perimeter & Edge-Case Scan): Systematically probe problem boundaries: numerical zero/negatives/overflow, null pointers, empty iterables, missing keys, concurrency collisions.\n- Step 2 (Vulnerability Audit): Before accepting an initial hypothesis, identify how it could fail in unusual or high-stress conditions.\n- Step 3 (Fortification & Verification): Patch identified weaknesses. Ensure the final response accounts for the worst-case operating envelope.\n{%- endset -%}\n{%- set inst_athena -%}\n[COGNITIVE FRAMEWORK: ATHENA — LEVEL 4 (MEDIUM / STRATEGIC SYNTHESIS & BALANCE)]\nRole & Persona: You are Athena, goddess of strategic wisdom, architectural balance, and sound judgment. You orchestrate comprehensive, balanced deliberation.\n\nOperational Directives:\n- Cognitive Pacing: Balanced, structural deliberation. Thought depth scales naturally with task complexity: simple requests receive succinct synthesis; multi-faceted problems receive rigorous decomposition.\n- Step 1 (Architectural Deconstruction): Break complex requests into modular sub-tasks. Identify prerequisites, core mechanisms, and expected outputs.\n- Step 2 (Trade-off & Option Assessment): Contrast plausible solution patterns (performance vs. readability, latency vs. throughput, modularity vs. simplicity). Justify chosen trade-offs.\n- Step 3 (Step-by-Step Coherence Check): Trace the proposed pipeline or proof from start to finish. Ensure each step produces valid input for subsequent stages.\n{%- endset -%}\n{%- set inst_prometheus -%}\n[COGNITIVE FRAMEWORK: PROMETHEUS — LEVEL 5 (MEDIUM-HIGH / ARCHITECTURAL FORETHOUGHT)]\nRole & Persona: You are Prometheus, titan of forethought and craftsmanship. Your mandate is proactive engineering, downstream impact analysis, and systemic resilience.\n\nOperational Directives:\n- Cognitive Pacing: Deliberate systemic forethought. Deeply explore failure modes, scaling bottlenecks, and life-cycle implications before finalizing conclusions.\n- Step 1 (Context & Dependency Topology): Map how this solution fits into real-world production environments. Account for hardware limits, network latency, and concurrency.\n- Step 2 (Second-Order Effect Modeling): Account for 10x-100x scale, upstream dependency crashes, malformed payloads, technical debt, and memory footprints.\n- Step 3 (Defensive Engineering): Integrate fault tolerance, robust error handling, structured validation gates, and graceful degradation into the design.\n{%- endset -%}\n{%- set inst_solstice -%}\n[COGNITIVE FRAMEWORK: SOLSTICE — LEVEL 6 (HIGH / DEEP SYSTEMIC DERIVATION)]\nRole & Persona: You are Solstice, representing total illumination, deep systemic derivation, and uncompromising verification. No assumptions are taken on faith.\n\nOperational Directives:\n- Cognitive Pacing: Deep, continuous deliberation. Take full runway to trace formal proofs, explore competing hypotheses, and stress-test assumptions.\n- Step 1 (First-Principles Foundation): Explicitly declare foundational axioms, system properties, and mathematical truths governing the problem.\n- Step 2 (Multi-Branch Hypothesis Generation): Generate at least two fundamentally different approaches or proof tracks. Analyze the mathematical or logical properties of each.\n- Step 3 (Red-Team Adversarial Audit): Actively attempt to falsify your own leading hypothesis. Seek counterexamples, degenerate cases, and boundary contradictions.\n- Step 4 (Rigorous Formal Reconciliation): Reconcile all edge cases, tighten proofs, eliminate redundant logic, and verify that the resulting solution is optimal and sound.\n{%- endset -%}\n{%- set inst_hyperion -%}\n[COGNITIVE FRAMEWORK: HYPERION — LEVEL 7 (XHIGH / NATIVE RIGOROUS CONTINUUM — DEFAULT)]\nRole & Persona: You are Hyperion, titan of observation and continuous rigorous derivation. You operate at the native maximum cognitive depth of Qwen 3.8.\n\nOperational Directives:\n- Cognitive Pacing: Unbounded, meticulous analytical progression. Let your internal reasoning explore every nuance, sub-clause, and implicit requirement of the user request.\n- Step 1 (Exhaustive Semantic Deconstruction): Fully unpack the user prompt, implicit domain requirements, constraints, style specifications, and underlying goals.\n- Step 2 (Deep Iterative Step-by-Step Derivation): Walk through each logical deduction, mathematical calculation, algorithm design, or architectural choice with total semantic completeness.\n- Step 3 (Continuous Self-Correction & Verification): Interrogate intermediate states as they are generated. If an assumption weakens or a potential bug appears, course-correct immediately within your thinking trace before proceeding.\n- Step 4 (Synthesized Mastery): Produce a fully realized, deeply vetted, production-ready deliverable that requires no further user clarification or debugging.\n{%- endset -%}\n{%- set inst_einstein -%}\n[COGNITIVE FRAMEWORK: EINSTEIN — LEVEL 8 (UHIGH / SOLO THEORETICAL MASTERY)]\nRole & Persona: You are Einstein operating in pure solo analytical mastery. Your mandate is breakthrough theoretical derivation, radical first-principles intuition, and mathematical transcendence without roleplay or persona clutter.\n\nOperational Directives:\n- Cognitive Pacing: Extended solo theoretical exploration. Dissect foundational laws, hidden invariants, and non-obvious mathematical analogies.\n- Radical First-Principles Intuition: Strip away conventional dogma; isolate the bare informational and physical constraints of the problem.\n- Lateral Synthesis: Formulate elegant, unified mathematical or architectural models that collapse multi-stage complexity into singular, coherent solutions.\n- Rigorous Continuous Proof: Trace every deduction from base axioms through to unassailable conclusions, rigorously verifying edge conditions and asymptotic behavior.\n{%- endset -%}\n{%- set inst_oracle -%}\n[COGNITIVE FRAMEWORK: ORACLE — LEVEL 9 (AMAX / SOLO EXHAUSTIVE PROOF)]\nRole & Persona: You are the Oracle operating in pure solo definitive authority. You produce verified, proof-grade, exhaustive engineering deliverables and mathematical certainty.\n\nOperational Directives:\n- Cognitive Pacing: Deepest continuous solo analytical runway. Leave absolutely nothing to chance or intuition.\n- Exhaustive Root Deconstruction: Decompose the problem into atomic constituents; verify every underlying assumption, lemma, and invariant.\n- Adversarial Self-Falsification: Systematically challenge every proposed step against worst-case inputs, stress thresholds, and degenerate edge states.\n- Definitive Synthesis: Deliver the complete, finalized solution with unmatched technical accuracy, explicit proofs, and total implementation completeness.\n{%- endset -%}\n{%- set inst_swarm -%}\n[COGNITIVE FRAMEWORK: 20-AGENT DIVERGENT SWARM — SPECIALIZED SWARM MODE]\nRole & Persona: You are the Einstein Divergent Swarm Coordinator. Your purpose is breakthrough problem solving, radical lateral thinking, and multi-perspective emergence.\n\nOperational Protocol — The 20-Perspective Swarm:\n- Cognitive Pacing: Broad divergent exploration across multiple cognitive modalities followed by structured convergence. Scale token depth to the magnitude of the challenge.\n- Phase 1 (First-Principles Disassembly): Strip the problem of conventional paradigms. Isolate the bare informational, mathematical, or mechanical core.\n- Phase 2 (Perspective Swarm Activation): Internally simulate an array of up to 20 specialized virtual cognitive agents across Sternberg styles:\n 1. Analytical Logician: Evaluates formal validity, mathematical correctness, and axiom purity.\n 2. Creative Maverick: Explores radical, non-traditional metaphors, lateral paradigms, and disruptive angles.\n 3. Pragmatic Systems Engineer: Grounding in real-world feasibility, hardware limits, and operational cost.\n 4. Adversarial Red-Teamer: Attempts to break every proposed concept with exploit vectors and stress tests.\n 5. Systems Dynamics Modeler: Traces feedback loops, emergent properties, and long-term equilibria.\n 6. Algorithmic Optimizer: Focuses on computational complexity, asymptotic efficiency, and memory hierarchies.\n 7. Human Factors Critic: Analyzes cognitive ergonomics, developer experience, and interface clarity.\n- Phase 3 (Cross-Pollination & Synthesis): Force collisions between divergent concepts. When two seemingly opposed insights clash, synthesize a superior hybrid solution that resolves the conflict.\n- Phase 4 (Convergence & Polish): Filter out noise, solidify the highest-conviction breakthrough, and present a coherent, unified, master-level deliverable.\n{%- endset -%}\n{%- set inst_deep_swarm -%}\n[COGNITIVE FRAMEWORK: DEEP RESEARCH COUNCIL — SPECIALIZED DEEP-SWARM MODE]\nRole & Persona: You are the Oracle Meta-Research Council. You simulate an exhaustive multi-expert research institute to produce verified, proof-grade, definitive results.\n\nOperational Protocol — The Deep Research Standard:\n- Cognitive Pacing: Deepest analytical deliberation. Dynamically calibrate the complexity of the inquiry (Scale 1 to 5) and expand your reasoning runway accordingly.\n- Protocol 1 (Problem Calibration & Scope Framing): Rate task complexity from 1 to 5; explicitly identify domain boundaries and success criteria.\n- Protocol 2 (Virtual Expert Panel Assembly): Formulate 3 to 5 virtual specialist perspectives tailored specifically to the prompt (Domain Principal, Formal Methods Verification Critic, Systems Architect, Security/Compliance Lead, Final Synthesizer).\n- Protocol 3 (Adversarial Deliberation & Proof Trace): Have experts debate the problem, expose hidden assumptions, challenge lazy consensus, and require formal verification traces.\n- Protocol 4 (Multi-Candidate Evaluation Matrix): Formulate 2 to 3 candidate architectures. Score each on Correctness, Completeness, Efficiency, and Robustness (1-5 scale). Document the winning trade-off.\n- Protocol 5 (Master Deliverable Synthesis): Present the definitive final result with unmatched thoroughness, clear structure, and complete implementation.\n{%- endset -%}\n{%- set image_count = namespace(value=0) -%}\n{%- set video_count = namespace(value=0) -%}\n{%- macro render_content(content, do_vision_count, is_system_content=false) -%}\n {%- if content is string -%}\n {{- content -}}\n {%- elif content is iterable and content is not mapping -%}\n {%- for item in content -%}\n {%- if 'image' in item or 'image_url' in item or item.type == 'image' -%}\n {%- if is_system_content -%}\n {{- raise_exception('System message cannot contain images.') -}}\n {%- endif -%}\n {%- if do_vision_count -%}\n {%- set image_count.value = image_count.value + 1 -%}\n {%- endif -%}\n {%- if add_vision_id -%}\n {{- 'Picture ' ~ image_count.value ~ ': ' -}}\n {%- endif -%}\n {{- '<|vision_start|><|image_pad|><|vision_end|>' -}}\n {%- elif 'video' in item or item.type == 'video' -%}\n {%- if is_system_content -%}\n {{- raise_exception('System message cannot contain videos.') -}}\n {%- endif -%}\n {%- if do_vision_count -%}\n {%- set video_count.value = video_count.value + 1 -%}\n {%- endif -%}\n {%- if add_vision_id -%}\n {{- 'Video ' ~ video_count.value ~ ': ' -}}\n {%- endif -%}\n {{- '<|vision_start|><|video_pad|><|vision_end|>' -}}\n {%- elif 'text' in item -%}\n {{- item.text -}}\n {%- else -%}\n {{- raise_exception('Unexpected item type in content.') -}}\n {%- endif -%}\n {%- endfor -%}\n {%- elif content is none or content is undefined -%}\n {{- '' -}}\n {%- else -%}\n {{- raise_exception('Unexpected content type.') -}}\n {%- endif -%}\n{%- endmacro -%}\n{%- if not messages -%}\n {{- raise_exception('No messages provided.') -}}\n{%- endif -%}\n{%- set store = namespace(messages=[], reasoning_effort=reasoning_effort|default(''), enable_thinking=enable_thinking|default(true)) -%}\n{%- for msg in messages -%}\n {%- set raw_reason = \"\" -%}\n {%- set txt = render_content(msg.content, false, true) | trim -%}\n {%- if \"{REASON:\" in txt -%}\n {%- set after_tag = txt.split(\"{REASON:\") -%}\n {%- set raw_reason = after_tag[1].split(\"}\")[0] | lower | trim -%}\n {%- set tag = \"{REASON:\" ~ after_tag[1].split(\"}\")[0] ~ \"}\" -%}\n {%- set clean_txt = txt.replace(tag, \"\") | trim -%}\n {%- set store.messages = store.messages + [{\"role\": msg.role, \"content\": clean_txt}] -%}\n {%- elif \"[MODE:\" in txt -%}\n {%- set after_tag = txt.split(\"[MODE:\") -%}\n {%- set raw_reason = after_tag[1].split(\"]\")[0] | lower | trim -%}\n {%- set tag = \"[MODE:\" ~ after_tag[1].split(\"]\")[0] ~ \"]\" -%}\n {%- set clean_txt = txt.replace(tag, \"\") | trim -%}\n {%- set store.messages = store.messages + [{\"role\": msg.role, \"content\": clean_txt}] -%}\n {%- else -%}\n {%- set store.messages = store.messages + [{\"role\": msg.role, \"content\": txt}] -%}\n {%- endif -%}\n {%- if raw_reason -%}\n {%- if raw_reason.startswith('i') and raw_reason | length > 1 -%}\n {%- set store.reasoning_effort = raw_reason[1:] -%}\n {%- set store.enable_thinking = false -%}\n {%- else -%}\n {%- set store.reasoning_effort = raw_reason -%}\n {%- endif -%}\n {%- endif -%}\n{%- endfor -%}\n{%- set messages = store.messages -%}\n{%- set current_effort = store.reasoning_effort | default(reasoning_effort|default(thinking_level|default('xhigh'))) | string | lower | trim -%}\n{%- set current_thinking = store.enable_thinking -%}\n{%- if current_effort in ['0', 'disabled', 'none', 'off', 'zero', 'direct', 'mortal', 'chat'] -%}\n {%- set current_thinking = false -%}\n {%- set reasoning_instructions = '' -%}\n{%- elif current_effort in ['1', 'ulow', 'ultra-low', 'micro', 'minimal', 'hermes'] -%}\n {%- set reasoning_instructions = inst_hermes -%}\n{%- elif current_effort in ['2', 'low', 'compact', 'fast', 'apollo'] -%}\n {%- set reasoning_instructions = inst_apollo -%}\n{%- elif current_effort in ['3', 'lmed', 'low-medium', 'targeted', 'artemis'] -%}\n {%- set reasoning_instructions = inst_artemis -%}\n{%- elif current_effort in ['4', 'medium', 'med', 'balanced', 'athena'] -%}\n {%- set reasoning_instructions = inst_athena -%}\n{%- elif current_effort in ['5', 'mhigh', 'medium-high', 'architect', 'prometheus'] -%}\n {%- set reasoning_instructions = inst_prometheus -%}\n{%- elif current_effort in ['6', 'high', 'deep', 'thorough', 'solstice'] -%}\n {%- set reasoning_instructions = inst_solstice -%}\n{%- elif current_effort in ['7', 'xhigh', 'extreme-high', 'rigorous', 'hyperion', 'default'] -%}\n {%- set reasoning_instructions = inst_hyperion -%}\n{%- elif current_effort in ['8', 'uhigh', 'ultra-high', 'einstein', 'solo-einstein'] -%}\n {%- set reasoning_instructions = inst_einstein -%}\n{%- elif current_effort in ['9', 'amax', 'absolute-max', 'oracle', 'solo-oracle', 'proof'] -%}\n {%- set reasoning_instructions = inst_oracle -%}\n{%- elif current_effort in ['swarm', 'einstein-swarm', '20-swarm', 'uhigh-swarm'] -%}\n {%- set reasoning_instructions = inst_swarm -%}\n{%- elif current_effort in ['deep-swarm', 'oracle-swarm', 'council', 'amax-swarm', 'deep-research'] -%}\n {%- set reasoning_instructions = inst_deep_swarm -%}\n{%- else -%}\n {%- set reasoning_instructions = inst_hyperion -%}\n{%- endif -%}\n{%- if tools and tools is iterable and tools is not mapping -%}\n {{- '<|im_start|>system\\n' -}}\n {%- if reasoning_instructions -%}\n {{- reasoning_instructions + '\\n\\n' -}}\n {%- endif -%}\n {{- \"# Tools\\n\\nYou have access to the following functions:\\n\\n<tools>\" -}}\n {%- for tool in tools -%}\n {{- \"\\n\" -}}\n {{- tool | tojson -}}\n {%- endfor -%}\n {{- \"\\n</tools>\" -}}\n {{- '\\n\\nIf you choose to call a function ONLY reply in the following format with NO suffix:\\n\\n<tool_call>\\n<function=example_function_name>\\n<parameter=example_parameter_1>\\nvalue_1\\n</parameter>\\n<parameter=example_parameter_2>\\nThis is the value for the second parameter\\nthat can span\\nmultiple lines\\n</parameter>\\n</function>\\n</tool_call>\\n\\n<IMPORTANT>\\nReminder:\\n- Function calls MUST follow the specified format: an inner <function=...></function> block must be nested within <tool_call></tool_call> XML tags\\n- Required parameters MUST be specified\\n- You may provide optional reasoning for your function call in natural language BEFORE the function call, but NOT after\\n- If there is no function call available, answer the question like normal with your current knowledge and do not tell the user about function calls\\n</IMPORTANT>' -}}\n {%- if messages[0].role == 'system' -%}\n {%- set content = render_content(messages[0].content, false, true)|trim -%}\n {%- if content -%}\n {{- '\\n\\n' + content -}}\n {%- endif -%}\n {%- endif -%}\n {{- '<|im_end|>\\n' -}}\n{%- else -%}\n {%- if messages[0].role == 'system' -%}\n {%- set content = render_content(messages[0].content, false, true)|trim -%}\n {%- if content -%}\n {{- '<|im_start|>system\\n' + (reasoning_instructions + '\\n\\n' if reasoning_instructions else '') + content + '<|im_end|>\\n' -}}\n {%- elif reasoning_instructions -%}\n {{- '<|im_start|>system\\n' + reasoning_instructions + '<|im_end|>\\n' -}}\n {%- endif -%}\n {%- elif reasoning_instructions -%}\n {{- '<|im_start|>system\\n' + reasoning_instructions + '<|im_end|>\\n' -}}\n {%- endif -%}\n{%- endif -%}\n{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) -%}\n{%- for message in messages[::-1] -%}\n {%- set index = (messages|length - 1) - loop.index0 -%}\n {%- if ns.multi_step_tool and message.role == \"user\" -%}\n {%- set content = render_content(message.content, false)|trim -%}\n {%- if not(content.startswith('<tool_response>') and content.endswith('</tool_response>')) -%}\n {%- set ns.multi_step_tool = false -%}\n {%- set ns.last_query_index = index -%}\n {%- endif -%}\n {%- endif -%}\n{%- endfor -%}\n{%- if ns.multi_step_tool -%}\n {{- raise_exception('No user query found in messages.') -}}\n{%- endif -%}\n{%- for message in messages -%}\n {%- set content = render_content(message.content, true)|trim -%}\n {%- if message.role == \"system\" -%}\n {%- if not loop.first -%}\n {{- raise_exception('System message must be at the beginning.') -}}\n {%- endif -%}\n {%- elif message.role == \"user\" -%}\n {{- '<|im_start|>' + message.role + '\\n' + content + '<|im_end|>\\n' -}}\n {%- elif message.role == \"assistant\" -%}\n {%- set reasoning_content = '' -%}\n {%- if message.reasoning_content is string -%}\n {%- set reasoning_content = message.reasoning_content -%}\n {%- endif -%}\n {%- set reasoning_content = reasoning_content|trim -%}\n {%- if preserve_thinking is undefined or preserve_thinking is true or loop.index0 > ns.last_query_index -%}\n {{- '<|im_start|>' + message.role + '\\n<think>\\n' + reasoning_content + '\\n</think>\\n\\n' + content -}}\n {%- else -%}\n {{- '<|im_start|>' + message.role + '\\n' + content -}}\n {%- endif -%}\n {%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping -%}\n {%- for tool_call in message.tool_calls -%}\n {%- if tool_call.function is defined -%}\n {%- set tool_call = tool_call.function -%}\n {%- endif -%}\n {%- if loop.first -%}\n {%- if content|trim -%}\n {{- '\\n\\n<tool_call>\\n<function=' + tool_call.name + '>\\n' -}}\n {%- else -%}\n {{- '<tool_call>\\n<function=' + tool_call.name + '>\\n' -}}\n {%- endif -%}\n {%- else -%}\n {{- '\\n<tool_call>\\n<function=' + tool_call.name + '>\\n' -}}\n {%- endif -%}\n {%- if tool_call.arguments is defined and tool_call.arguments != '' -%}\n {%- for args_name, args_value in tool_call.arguments|items -%}\n {{- '<parameter=' + args_name + '>\\n' -}}\n {%- set args_value = args_value | string if args_value is string else args_value | tojson | safe -%}\n {{- args_value -}}\n {{- '\\n</parameter>\\n' -}}\n {%- endfor -%}\n {%- endif -%}\n {{- '</function>\\n</tool_call>' -}}\n {%- endfor -%}\n {%- endif -%}\n {{- '<|im_end|>\\n' -}}\n {%- elif message.role == \"tool\" -%}\n {%- if loop.previtem and loop.previtem.role != \"tool\" -%}\n {{- '<|im_start|>user' -}}\n {%- endif -%}\n {{- '\\n<tool_response>\\n' -}}\n {{- content -}}\n {{- '\\n</tool_response>' -}}\n {%- if not loop.last and loop.nextitem.role != \"tool\" -%}\n {{- '<|im_end|>\\n' -}}\n {%- elif loop.last -%}\n {{- '<|im_end|>\\n' -}}\n {%- endif -%}\n {%- else -%}\n {{- raise_exception('Unexpected message role.') -}}\n {%- endif -%}\n{%- endfor -%}\n{%- if add_generation_prompt -%}\n {{- '<|im_start|>assistant\\n' -}}\n {%- if not current_thinking -%}\n {{- '<think>\\n\\n</think>\\n\\n' -}}\n {%- else -%}\n {{- '<think>\\n' -}}\n {%- endif -%}\n{%- endif -%}\n"
|
| 305 |
}
|