olmo3DefaultSystemMessage="You are a helpful function-calling AI assistant. "
olmo31DefaultSystemMessage="You are Olmo, a helpful AI assistant built by Ai2. Your date cutoff is December 2024, and your model weights are available at https://huggingface.co/allenai. "
olmo3NoFunctionsMessage="You do not currently have access to any functions. "
olmo3WithFunctionsMessage="You are provided with function signatures within <functions></functions> XML tags. You may call one or more functions to assist with the user query. Output any function calls within <function_calls></function_calls> XML tags. Do not make assumptions about what values to plug into functions."
olmo3ThinkDefaultSystemMessage="You are OLMo, a helpful function-calling AI assistant built by Ai2. Your date cutoff is November 2024, and your model weights are available at https://huggingface.co/allenai."
olmo3ThinkNoFunctionsMessage=" You do not currently have access to any functions."
// Olmo3Think32B is for allenai/Olmo-3-32B-Think
Olmo3Think32BOlmo3ThinkVariant=iota
// Olmo31Think is for allenai/Olmo-3-7B-Think and allenai/Olmo-3.1-32B-Think (includes model info)
Olmo31Think
)
typeOlmo3ThinkRendererstruct{}
typeolmo3ThinkToolCallstruct{
IDstring`json:"id,omitempty"`
Typestring`json:"type,omitempty"`
Functionolmo3ThinkToolCallFunc`json:"function"`
}
const(
olmo3ThinkFunctionsSuffix=" You do not currently have access to any functions. <functions></functions>"
olmo3Think32BSystemMessage="You are a helpful AI assistant."
olmo31ThinkSystemMessage="You are Olmo, a helpful AI assistant built by Ai2. Your date cutoff is December 2024, and your model weights are available at https://huggingface.co/allenai."
name:"basic without system - adds default system",
name:"7b_basic_without_system",
variant:Olmo31Think,
msgs:[]api.Message{
{Role:"user",Content:"Hello!"},
},
expected:"<|im_start|>system\n"+
"You are OLMo, a helpful function-calling AI assistant built by Ai2. Your date cutoff is November 2024, and your model weights are available at https://huggingface.co/allenai. You do not currently have access to any functions. <functions></functions><|im_end|>\n"+
"You are Olmo, a helpful AI assistant built by Ai2. Your date cutoff is December 2024, and your model weights are available at https://huggingface.co/allenai.<|im_end|>\n"+
"<|im_start|>user\n"+
"Hello!<|im_end|>\n"+
"<|im_start|>assistant\n"+
"<think>",
},
{
name:"with system message no tools",
name:"7b_with_custom_system",
variant:Olmo31Think,
msgs:[]api.Message{
{Role:"system",Content:"You are a helpful assistant."},
`You are a helpful assistant. <functions>[{"type": "function", "function": {"name": "get_weather", "description": "Get the current weather", "parameters": {"type": "object", "required": ["location"], "properties": {"location": {"type": "string", "description": "The city"}}}}}]</functions><|im_end|>`+"\n"+
"You are Olmo, a helpful AI assistant built by Ai2. Your date cutoff is December 2024, and your model weights are available at https://huggingface.co/allenai.<|im_end|>\n"+
"<|im_start|>user\n"+
"What is the weather?<|im_end|>\n"+
"<|im_start|>assistant\n"+
"<think>",
},
{
name:"assistant with tool calls",
name:"7b_tool_calls_and_tool_messages_ignored",
variant:Olmo31Think,
msgs:[]api.Message{
{Role:"system",Content:"You are a helpful assistant."},
{Role:"user",Content:"What is the weather in SF?"},
`You are a helpful assistant. <functions>[{"type": "function", "function": {"name": "get_weather", "description": "Get the current weather", "parameters": {"type": "object", "required": ["location"], "properties": {"location": {"type": "string", "description": "The city"}}}}}]</functions><|im_end|>`+"\n"+
"You are Olmo, a helpful AI assistant built by Ai2. Your date cutoff is December 2024, and your model weights are available at https://huggingface.co/allenai.<|im_end|>\n"+
"<|im_start|>user\n"+
"What is the weather in SF?<|im_end|>\n"+
"<|im_start|>assistant\n"+
`Let me check the weather.<function_calls>[{"id": "call_1", "type": "function", "function": {"name": "get_weather", "arguments": "{\"location\":\"San Francisco\"}"}}]</function_calls><|im_end|>`+"\n"+
"<|im_start|>environment\n"+
`{"temperature": 68}<|im_end|>`+"\n"+
"Let me check the weather.<|im_end|>\n"+
"<|im_start|>assistant\n"+
"<think>",
},
{
name:"multi-turn conversation",
name:"7b_multi_turn_conversation",
variant:Olmo31Think,
msgs:[]api.Message{
{Role:"system",Content:"You are a helpful assistant."},
{Role:"user",Content:"Hello"},
{Role:"assistant",Content:"Hi there!"},
{Role:"user",Content:"How are you?"},
},
expected:"<|im_start|>system\n"+
"You are a helpful assistant. You do not currently have access to any functions. <functions></functions><|im_end|>\n"+
"You are Olmo, a helpful AI assistant built by Ai2. Your date cutoff is December 2024, and your model weights are available at https://huggingface.co/allenai.<|im_end|>\n"+
"You are a helpful assistant. You do not currently have access to any functions. <functions></functions><|im_end|>\n"+
"<|im_start|>user\n"+
"Hello!<|im_end|>\n"+
"<|im_start|>assistant\n"+
"<think>",
},
tools:[]api.Tool{
{
Type:"function",
Function:api.ToolFunction{
Name:"get_weather",
Parameters:api.ToolFunctionParameters{
Type:"object",
Properties:map[string]api.ToolProperty{
"location":{Type:api.PropertyType{"string"}},
},
},
},
},
name:"31_basic_without_system",
variant:Olmo31Think,
msgs:[]api.Message{
{Role:"user",Content:"Hello!"},
},
expected:"<|im_start|>system\n"+
`You are OLMo, a helpful function-calling AI assistant built by Ai2. Your date cutoff is November 2024, and your model weights are available at https://huggingface.co/allenai. <functions>[{"type": "function", "function": {"name": "get_weather", "parameters": {"type": "object", "properties": {"location": {"type": "string"}}}}}]</functions><|im_end|>`+"\n"+
"You are Olmo, a helpful AI assistant built by Ai2. Your date cutoff is December 2024, and your model weights are available at https://huggingface.co/allenai.<|im_end|>\n"+
name:"assistant message only content no tool calls",
name:"31_with_custom_system_gets_suffix",
variant:Olmo31Think,
msgs:[]api.Message{
{Role:"user",Content:"Tell me a joke"},
{Role:"assistant",Content:"Why did the chicken cross the road?"},
{Role:"user",Content:"I don't know, why?"},
{Role:"system",Content:"You are a helpful assistant."},
{Role:"user",Content:"Hello!"},
},
expected:"<|im_start|>system\n"+
"You are OLMo, a helpful function-calling AI assistant built by Ai2. Your date cutoff is November 2024, and your model weights are available at https://huggingface.co/allenai. You do not currently have access to any functions. <functions></functions><|im_end|>\n"+
"<|im_start|>user\n"+
"Tell me a joke<|im_end|>\n"+
"<|im_start|>assistant\n"+
"Why did the chicken cross the road?<|im_end|>\n"+
"You are a helpful assistant. You do not currently have access to any functions. <functions></functions><|im_end|>\n"+