This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ./build/bin/llama-server -fa on -n 32768 -fit off -ngl -1 --models-dir ~/.cache/huggingface --models-max 1 --chat-template-file ~/rwkv7-chat-template-tool-calling-30.jinja --chat-template-kwargs '{"tools": [{"name":"web_search","description":"Search the web for current information","parameters":{"query":{"type":"string","required":true},"max_results":{"type":"integer","default":5}}},{"name":"get_weather","description":"Get current weather for a specific location","parameters":{"location":{"type":"string","required":true},"units":{"type":"string","enum":["celsius","fahrenheit"],"default":"celsius"}}},{"name":"calculator","description":"Perform mathematical calculations","parameters":{"expression":{"type":"string","required":true}}},{"name":"send_email","description":"Send an email to a recipient","parameters":{"to":{"type":"string","required":true},"subject":{"type":"string","required":true},"body":{"type":"string","required":true},"attachments":{"type":"array","items":"string","default":[]}}},{"name":"search_ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ./build/bin/llama-server -fa on -n 32768 -fit off -ngl -1 --models-dir ~/.cache/huggingface --models-max 1 --chat-template-file ~/rwkv7-chat-template-tool-calling-30.jinja --chat-template-kwargs '{"tools": [{"name":"web_search","description":"Search the web for current information","parameters":{"query":{"type":"string","required":true},"max_results":{"type":"integer","default":5}}},{"name":"get_weather","description":"Get current weather for a specific location","parameters":{"location":{"type":"string","required":true},"units":{"type":"string","enum":["celsius","fahrenheit"],"default":"celsius"}}},{"name":"calculator","description":"Perform mathematical calculations","parameters":{"expression":{"type":"string","required":true}}},{"name":"send_email","description":"Send an email to a recipient","parameters":{"to":{"type":"string","required":true},"subject":{"type":"string","required":true},"body":{"type":"string","required":true},"attachments":{"type":"array","items":"string","default":[]}}},{"name":"search_ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### Assistant | |
| <think> | |
| The tool returned weather data: temperature 18°C, partly cloudy, humidity 65%, wind speed 12 km/h. The user asked "What's the weather like in Berlin right now?" So we should respond with a concise answer summarizing the weather. Possibly include temperature, condition, humidity, wind speed. Also note that it's in Celsius. | |
| We should respond in a friendly manner. | |
| Thus answer: "Right now in Berlin it's partly cloudy with a temperature of 18°C, humidity 65%, and a gentle wind of about 12 km/h." | |
| We can also mention that it's a nice day. | |
| Thus final answer. | |
| </think> | |
| Right now in Berlin it’s **partly cloudy** with a temperature of **18 °C**, humidity around **65 %**, and a gentle wind of about **12 km/h**. It’s a pleasant day! | |
| final_answer=The user asks: "What's the weather like in Berlin right now?" We need to use the get_weather tool. The tool expects location and optionally units. The default units are celsius. So we can call get_weather with location "Berlin". The tool will return current we |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ./build/bin/llama-server -fa on -n 32768 -fit off -ngl -1 --models-dir ~/.cache/huggingface --models-max 1 --chat-template-file ~/rwkv7-chat-template-tool-calling-27.jinja --chat-template-kwargs '{"tools": [{"name":"web_search","description":"Search the web for current information","parameters":{"query":{"type":"string","required":true},"max_results":{"type":"integer","default":5}}},{"name":"get_weather","description":"Get current weather for a specific location","parameters":{"location":{"type":"string","required":true},"units":{"type":"string","enum":["celsius","fahrenheit"],"default":"celsius"}}},{"name":"calculator","description":"Perform mathematical calculations","parameters":{"expression":{"type":"string","required":true}}},{"name":"send_email","description":"Send an email to a recipient","parameters":{"to":{"type":"string","required":true},"subject":{"type":"string","required":true},"body":{"type":"string","required":true},"attachments":{"type":"array","items":"string","default":[]}}},{"name":"search_ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ./build/bin/llama-server -fa on -n 32768 -fit off -ngl -1 --models-dir ~/.cache/huggingface --models-max 1 --chat-template-file ~/rwkv7-chat-template-tool-calling-22.jinja --chat-template-kwargs '{"tools": [{"name":"web_search","description":"Search the web for current information","parameters":{"query":{"type":"string","required":true},"max_results":{"type":"integer","default":5}}},{"name":"get_weather","description":"Get current weather for a specific location","parameters":{"location":{"type":"string","required":true},"units":{"type":"string","enum":["celsius","fahrenheit"],"default":"celsius"}}},{"name":"calculator","description":"Perform mathematical calculations","parameters":{"expression":{"type":"string","required":true}}},{"name":"send_email","description":"Send an email to a recipient","parameters":{"to":{"type":"string","required":true},"subject":{"type":"string","required":true},"body":{"type":"string","required":true},"attachments":{"type":"array","items":"string","default":[]}}},{"name":"search_ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ./build/bin/llama-server -fa on -n 32768 -fit off -ngl -1 --models-dir ~/.cache/huggingface --models-max 1 --chat-template-file ~/rwkv7-chat-template-tool-calling-21.jinja --chat-template-kwargs '{"tools": [{"name":"web_search","description":"Search the web for current information","parameters":{"query":{"type":"string","required":true},"max_results":{"type":"integer","default":5}}},{"name":"get_weather","description":"Get current weather for a specific location","parameters":{"location":{"type":"string","required":true},"units":{"type":"string","enum":["celsius","fahrenheit"],"default":"celsius"}}},{"name":"calculator","description":"Perform mathematical calculations","parameters":{"expression":{"type":"string","required":true}}},{"name":"send_email","description":"Send an email to a recipient","parameters":{"to":{"type":"string","required":true},"subject":{"type":"string","required":true},"body":{"type":"string","required":true},"attachments":{"type":"array","items":"string","default":[]}}},{"name":"search_ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {%- if not add_generation_prompt is defined %} | |
| {%- set add_generation_prompt = true %} | |
| {%- endif %} | |
| {%- set ns = namespace(system_prompt='', has_tools=false) %} | |
| {%- for message in messages %} | |
| {%- if message.role == 'system' %} | |
| {%- set ns.system_prompt = message.content %} | |
| {%- endif %} | |
| {%- endfor %} | |
| {%- if tools is defined and tools | length > 0 %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ./build/bin/llama-server -v -lv 4 -fa on -n 16384 -fit off -ngl -1 --models-dir ~/.cache/huggingface --models-max 1 --chat-template-file ~/rwkv7-chat-template-tool-calling-16.jinja --chat-template-kwargs '{"tools": [{"name":"web_search","description":"Search the web for current information","parameters":{"query":{"type":"string","required":true},"max_results":{"type":"integer","default":5}}},{"name":"get_weather","description":"Get current weather for a specific location","parameters":{"location":{"type":"string","required":true},"units":{"type":"string","enum":["celsius","fahrenheit"],"default":"celsius"}}},{"name":"calculator","description":"Perform mathematical calculations","parameters":{"expression":{"type":"string","required":true}}},{"name":"send_email","description":"Send an email to a recipient","parameters":{"to":{"type":"string","required":true},"subject":{"type":"string","required":true},"body":{"type":"string","required":true},"attachments":{"type":"array","items":"string","default":[]}}},{"name" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {%- if not add_generation_prompt is defined -%} | |
| {%- set add_generation_prompt = true -%} | |
| {%- endif -%} | |
| {%- set ns = namespace(system_prompt='', has_tools=false) -%} | |
| {# 1. Extract System Prompt and Check for Tools #} | |
| {%- for message in messages -%} | |
| {%- if message['role'] == 'system' -%} | |
| {%- set ns.system_prompt = message['content'] -%} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ''' | |
| PEG - Parsing Combinators | |
| Example: Simple JSON parser | |
| ''' | |
| from typing import Any, Callable | |
| from string import digits, ascii_letters, whitespace | |
| class JsonParser: | |
| ''' | |
| VALUE ::= STRING | NUMBER | OBJECT | ARRAY |
NewerOlder