expectedThinking:"First part of thinking. Second part of thinking. Third part.",
expectedContent:"Content here.",
},
{
name:"thinking_chunks_with_newlines",
chunks:[]string{
"Step 1: Analyze the problem.\n",
"Step 2: Consider options.\n",
"Step 3: Make decision.</think>",
"Here is my answer.",
},
expectedThinking:"Step 1: Analyze the problem.\nStep 2: Consider options.\nStep 3: Make decision.",
expectedContent:"Here is my answer.",
},
{
name:"single_char_thinking_chunks",
chunks:[]string{
"H","e","l","l","o","</think>","World",
},
expectedThinking:"Hello",
expectedContent:"World",
},
{
name:"thinking_with_special_chars",
chunks:[]string{
"Let me think... ",
"Option A: $100 ",
"Option B: €200</think>",
"I recommend Option A.",
},
expectedThinking:"Let me think... Option A: $100 Option B: €200",
expectedContent:"I recommend Option A.",
},
{
name:"long_thinking_multiple_chunks",
chunks:[]string{
"This is a very long thinking process. ",
"I need to consider many factors. ",
"First, let me look at the data. ",
"The numbers show interesting patterns. ",
"Based on my analysis, ",
"I can conclude that...</think>",
"The answer is 42.",
},
expectedThinking:"This is a very long thinking process. I need to consider many factors. First, let me look at the data. The numbers show interesting patterns. Based on my analysis, I can conclude that...",
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."
name:"basic without system - adds default system",
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"+
"<|im_start|>user\n"+
"Hello!<|im_end|>\n"+
"<|im_start|>assistant\n"+
"<think>",
},
{
name:"with system message no tools",
msgs:[]api.Message{
{Role:"system",Content:"You are a helpful assistant."},
{Role:"user",Content:"Hello!"},
},
expected:"<|im_start|>system\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>",
},
{
name:"with system message and tools",
msgs:[]api.Message{
{Role:"system",Content:"You are a helpful assistant."},
`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"+
name:"assistant message only content no tool calls",
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?"},
},
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"+