{ "add_bos_token": false, "add_eos_token": false, "add_prefix_space": null, "added_tokens_decoder": { "0": { "content": "", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": true }, "1": { "content": "", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": false }, "2": { "content": "<|endoftext|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": true }, "32000": { "content": "", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "32001": { "content": "", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "32002": { "content": "", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "32003": { "content": "", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "32004": { "content": "", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "32005": { "content": "", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "32006": { "content": "", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "32007": { "content": "", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "32008": { "content": "", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "32009": { "content": "", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "32010": { "content": "", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "32011": { "content": "", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "32012": { "content": "", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "32013": { "content": "", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "32014": { "content": "", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "32015": { "content": "", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "32016": { "content": "", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "32017": { "content": "", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "32018": { "content": "", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "32019": { "content": "", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "32020": { "content": "", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "32021": { "content": "", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "32022": { "content": "", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "32023": { "content": "", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "32024": { "content": "<|endofsystemprompt|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "32025": { "content": "<|beginofsystem|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "32026": { "content": "<|beginofuser|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "32027": { "content": "<|endofchat|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true } }, "additional_special_tokens": [ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "<|endofsystemprompt|>", "<|beginofsystem|>", "<|beginofuser|>", "<|endofchat|>" ], "bos_token": "<|endoftext|>", "chat_template": [ { "name": "default", "template": "{% for message in messages %}{% if message['role'] == 'user' %}{{ '<|beginofuser|>' + message['content'] }}{% elif message['role'] == 'system' %}{{ message['content'] + '<|endofsystemprompt|>' }}{% elif message['role'] == 'assistant' %}{{ '<|beginofsystem|>' + message['content'] }}{% endif %}{% if loop.last and add_generation_prompt %}{{ '<|beginofsystem|>' }}{% endif %}{% endfor %}" }, { "name": "tool_use", "template": "{%- macro json_to_python_type(json_spec) %}\n{%- set basic_type_map = {\n \"string\": \"str\",\n \"number\": \"float\",\n \"integer\": \"int\",\n \"boolean\": \"bool\"\n} %}\n\n{%- if basic_type_map[json_spec.type] is defined %}\n {{- basic_type_map[json_spec.type] }}\n{%- elif json_spec.type == \"array\" %}\n {{- \"list[\" + json_to_python_type(json_spec|items) + \"]\"}}\n{%- elif json_spec.type == \"object\" %}\n {%- if json_spec.additionalProperties is defined %}\n {{- \"dict[str, \" + json_to_python_type(json_spec.additionalProperties) + ']'}}\n {%- else %}\n {{- \"dict\" }}\n {%- endif %}\n{%- elif json_spec.type is iterable %}\n {{- \"Union[\" }}\n {%- for t in json_spec.type %}\n {{- json_to_python_type({\"type\": t}) }}\n {%- if not loop.last %}\n {{- \",\" }} \n {%- endif %}\n {%- endfor %}\n {{- \"]\" }}\n{%- else %}\n {{- \"Any\" }}\n{%- endif %}\n{%- endmacro %}\n\n\n{{- \"You are a function calling AI model. You are provided with function signatures within XML tags. You may call one or more functions to assist with the user query. Don't make assumptions about what values to plug into functions. Here are the available tools\\n\\n\" }}\n{%- for tool in tools %}\n {%- if tool.function is defined %}\n {%- set tool = tool.function %}\n {%- endif %}\n {{ '{\"type\": \"function\", \"function\": ' }}\n {{- '{\"name\": ' + tool.name + '\", ' }}\n {{- '\"description\": \"' + tool.name + '(' }}\n {%- for param_name, param_fields in tool.parameters.properties|items %}\n {{- param_name + \": \" + json_to_python_type(param_fields) }}\n {%- if not loop.last %}\n {{- \", \" }}\n {%- endif %}\n {%- endfor %}\n {{- \")\" }}\n {%- if tool.return is defined %}\n {{- \" -> \" + json_to_python_type(tool.return) }}\n {%- endif %}\n {{- \" - \" + tool.description + \"\\n\\n\" }}\n {%- for param_name, param_fields in tool.parameters.properties|items %}\n {%- if loop.first %}\n {{- \" Args:\" }}\n {%- endif %}\n {{- \"\\n \" + param_name + \"(\" + json_to_python_type(param_fields) + \"): \" + param_fields.description|trim }}\n {%- endfor %}\n {%- if tool.return is defined and tool.return.description is defined %}\n {{- \"\\n Returns:\\n \" + tool.return.description }}\n {%- endif %}\n {{- '\"' }}\n {{- ', \"parameters\": ' }}\n {%- if tool.parameters.properties | length == 0 %}\n {{- \"{}\" }}\n {%- else %}\n {{- tool.parameters|tojson }}\n {%- endif %}\n {{- \"}\" }}\n {%- if not loop.last %}\n {{- \"\\n\" }}\n {%- endif %}\n{%- endfor %}\n{{- \"\\n\\n\" }}\n{{- 'Use the following pydantic model json schema for each tool call you will make: {\"properties\": {\"arguments\": {\"title\": \"Arguments\", \"type\": \"object\"}, \"name\": {\"title\": \"Name\", \"type\": \"string\"}}, \"required\": [\"arguments\", \"name\"], \"title\": \"FunctionCall\", \"type\": \"object\"}\n' }}\n{{- \"For each function call return a json object with function name and arguments within XML tags as follows:\n\" }}\n{{- \"\n\" }}\n{{- '{\"arguments\": , \"name\": }\n' }}\n{{- '<|endofsystemprompt|>' }}\n{%- for message in messages %}{%- if message.role == \"user\" %}{{- '<|beginofuser|>' + message.content }}{%- elif (message.role == \"assistant\" and message.tool_calls is not defined) %} {{- '<|beginofsystem|>' + message.content }}{%- elif message.role == \"assistant\" %}{{- '\\n' }}{%- for tool_call in message.tool_calls %}{%- if tool_call.function is defined %}{%- set tool_call = tool_call.function %}{%- endif %}{{- '{ ' }}{%- if tool_call.arguments is defined %}{{- '\"arguments\": ' }}{{- tool_call.arguments|tojson }}{{- ', '}}{%- endif %}{{- '\"name\": \"' }}{{- tool_call.name }}{{- '\"}' }}{{- '\\n ' }}\n {%- endfor %}{%- elif message.role == \"tool\" %}{%- if not message.name is defined %}{{- raise_exception(\"Tool response dicts require a 'name' key indicating the name of the called function!\") }}{%- endif %}{{- '\\n' }}{{- '{\"name\": \"' }}{{- message.name }}{{- '\", \"content\": ' }}{{- message.content|tojson + '}' }}{{- '\\n\\n' }}{%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}{{- '<|beginofsystem|>' }}{%- endif %}\n" } ], "clean_up_tokenization_spaces": false, "eos_token": "<|endoftext|>", "legacy": true, "model_max_length": 8192, "pad_token": null, "sp_model_kwargs": {}, "tokenizer_class": "LlamaTokenizer", "unk_token": "", "use_default_system_prompt": false }