expected:`<|begin▁of▁sentence|>You are Cogito, an AI assistant created by Deep Cogito, which is an AI research lab based in San Francisco.<|User|>Hello, how are you?<|Assistant|>`,
},
{
name:"basic with system message",
messages:[]api.Message{
{Role:"system",Content:"You are a helpful assistant."},
{Role:"user",Content:"Hello, how are you?"},
},
thinkValue:&api.ThinkValue{Value:false},
expected:`<|begin▁of▁sentence|>You are Cogito, an AI assistant created by Deep Cogito, which is an AI research lab based in San Francisco.
You are a helpful assistant.<|User|>Hello, how are you?<|Assistant|>`,
},
{
name:"conversation with assistant response",
messages:[]api.Message{
{Role:"user",Content:"What is the capital of France?"},
{Role:"assistant",Content:"The capital of France is Paris."},
{Role:"user",Content:"Fantastic!"},
},
thinkValue:&api.ThinkValue{Value:false},
expected:`<|begin▁of▁sentence|>You are Cogito, an AI assistant created by Deep Cogito, which is an AI research lab based in San Francisco.<|User|>What is the capital of France?<|Assistant|>The capital of France is Paris.<|end▁of▁sentence|><|User|>Fantastic!<|Assistant|>`,
},
{
name:"thinking enabled without system",
messages:[]api.Message{
{Role:"user",Content:"Hello, how are you?"},
},
thinkValue:&api.ThinkValue{Value:true},
expected:`<|begin▁of▁sentence|>Enable deep thinking subroutine.
You are Cogito, an AI assistant created by Deep Cogito, which is an AI research lab based in San Francisco.<|User|>Hello, how are you?<|Assistant|><think>
`,
},
{
name:"thinking enabled with system",
messages:[]api.Message{
{Role:"system",Content:"You are a helpful assistant."},
{Role:"user",Content:"Hello, how are you?"},
},
thinkValue:&api.ThinkValue{Value:true},
expected:`<|begin▁of▁sentence|>Enable deep thinking subroutine.
You are Cogito, an AI assistant created by Deep Cogito, which is an AI research lab based in San Francisco.
You are a helpful assistant.
<|User|>Hello, how are you?<|Assistant|><think>
`,
},
{
name:"thinking disabled",
messages:[]api.Message{
{Role:"user",Content:"Hello, how are you?"},
},
thinkValue:&api.ThinkValue{Value:false},
expected:`<|begin▁of▁sentence|>You are Cogito, an AI assistant created by Deep Cogito, which is an AI research lab based in San Francisco.<|User|>Hello, how are you?<|Assistant|>`,
},
{
name:"with tools",
messages:[]api.Message{
{Role:"user",Content:"What's the weather like?"},
},
thinkValue:&api.ThinkValue{Value:false},
tools:[]api.Tool{
{
Type:"function",
Function:api.ToolFunction{
Name:"get_weather",
Description:"Get current weather",
Parameters:api.ToolFunctionParameters{
Type:"object",
Properties:map[string]api.ToolProperty{
"location":{
Type:api.PropertyType{"string"},
Description:"City name",
},
},
Required:[]string{"location"},
},
},
},
},
expected:`<|begin▁of▁sentence|>You are Cogito, an AI assistant created by Deep Cogito, which is an AI research lab based in San Francisco.
You have the following functions available:
`+"```json\n"+`{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get current weather",
"parameters": {
"type": "object",
"required": [
"location"
],
"properties": {
"location": {
"type": "string",
"description": "City name"
}
}
}
}
}
`+"```\n"+`<|User|>What's the weather like?<|Assistant|>`,
},
{
name:"assistant with tool calls",
messages:[]api.Message{
{Role:"user",Content:"What's the weather in Paris?"},
{
Role:"assistant",
Content:"I'll check the weather in Paris for you.",
ToolCalls:[]api.ToolCall{
{
Function:api.ToolCallFunction{
Name:"get_weather",
Arguments:api.ToolCallFunctionArguments{
"location":"Paris",
},
},
},
},
},
},
thinkValue:&api.ThinkValue{Value:false},
expected:`<|begin▁of▁sentence|>You are Cogito, an AI assistant created by Deep Cogito, which is an AI research lab based in San Francisco.<|User|>What's the weather in Paris?<|Assistant|>I'll check the weather in Paris for you.<|tool▁calls▁begin|><|tool▁call▁begin|>function<|tool▁sep|>get_weather
{Role:"user",Content:"What's the weather in Paris?"},
{
Role:"assistant",
ToolCalls:[]api.ToolCall{
{
Function:api.ToolCallFunction{
Name:"get_weather",
Arguments:api.ToolCallFunctionArguments{
"location":"Paris",
},
},
},
},
},
{Role:"tool",Content:"Temperature: 22°C, Sunny"},
},
thinkValue:&api.ThinkValue{Value:false},
expected:`<|begin▁of▁sentence|>You are Cogito, an AI assistant created by Deep Cogito, which is an AI research lab based in San Francisco.<|User|>What's the weather in Paris?<|Assistant|><|tool▁calls▁begin|><|tool▁call▁begin|>function<|tool▁sep|>get_weather
{Role:"user",Content:"Get weather for Paris and London"},
{
Role:"assistant",
ToolCalls:[]api.ToolCall{
{
Function:api.ToolCallFunction{
Name:"get_weather",
Arguments:api.ToolCallFunctionArguments{
"location":"Paris",
},
},
},
{
Function:api.ToolCallFunction{
Name:"get_weather",
Arguments:api.ToolCallFunctionArguments{
"location":"London",
},
},
},
},
},
{Role:"tool",Content:"Paris: 22°C, Sunny"},
{Role:"tool",Content:"London: 18°C, Cloudy"},
},
thinkValue:&api.ThinkValue{Value:false},
expected:`<|begin▁of▁sentence|>You are Cogito, an AI assistant created by Deep Cogito, which is an AI research lab based in San Francisco.<|User|>Get weather for Paris and London<|Assistant|><|tool▁calls▁begin|><|tool▁call▁begin|>function<|tool▁sep|>get_weather
expected:`<|begin▁of▁sentence|>Enable deep thinking subroutine.
You are Cogito, an AI assistant created by Deep Cogito, which is an AI research lab based in San Francisco.
You have the following functions available:
`+"```json\n"+`{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get current weather",
"parameters": {
"type": "object",
"required": [
"location"
],
"properties": {
"location": {
"type": "string",
"description": "City name"
}
}
}
}
}
`+"```\n"+`<|User|>What's the weather like?<|Assistant|><think>
`,
},
// test cases based on cogito
{
name:"single_turn_thinking_false",
messages:[]api.Message{
{Role:"user",Content:"Hello"},
},
thinkValue:&api.ThinkValue{Value:false},
expected:`<|begin▁of▁sentence|>You are Cogito, an AI assistant created by Deep Cogito, which is an AI research lab based in San Francisco.<|User|>Hello<|Assistant|>`,
},
{
name:"single_turn_thinking_true",
messages:[]api.Message{
{Role:"user",Content:"Hello"},
},
thinkValue:&api.ThinkValue{Value:true},
expected:`<|begin▁of▁sentence|>Enable deep thinking subroutine.
You are Cogito, an AI assistant created by Deep Cogito, which is an AI research lab based in San Francisco.<|User|>Hello<|Assistant|><think>
`,
},
{
name:"multi_turn_thinking_false",
messages:[]api.Message{
{Role:"user",Content:"Hello"},
{Role:"assistant",Content:"Hi there!"},
{Role:"user",Content:"How are you?"},
},
thinkValue:&api.ThinkValue{Value:false},
expected:`<|begin▁of▁sentence|>You are Cogito, an AI assistant created by Deep Cogito, which is an AI research lab based in San Francisco.<|User|>Hello<|Assistant|>Hi there!<|end▁of▁sentence|><|User|>How are you?<|Assistant|>`,
},
{
name:"multi_turn_thinking_true",
messages:[]api.Message{
{Role:"user",Content:"Hello"},
{Role:"assistant",Content:"Hi there!"},
{Role:"user",Content:"How are you?"},
},
thinkValue:&api.ThinkValue{Value:true},
expected:`<|begin▁of▁sentence|>Enable deep thinking subroutine.
You are Cogito, an AI assistant created by Deep Cogito, which is an AI research lab based in San Francisco.<|User|>Hello<|Assistant|>Hi there!<|end▁of▁sentence|><|User|>How are you?<|Assistant|><think>
`,
},
{
name:"multi_with_system_thinking_false",
messages:[]api.Message{
{Role:"system",Content:"You are a helpful assistant"},
{Role:"user",Content:"Start"},
{Role:"assistant",Content:"Okay"},
},
thinkValue:&api.ThinkValue{Value:false},
expected:`<|begin▁of▁sentence|>You are Cogito, an AI assistant created by Deep Cogito, which is an AI research lab based in San Francisco.
You are a helpful assistant<|User|>Start<|Assistant|>Okay<|end▁of▁sentence|><|Assistant|>`,
},
{
name:"multi_with_system_thinking_true",
messages:[]api.Message{
{Role:"system",Content:"You are a helpful assistant"},
{Role:"user",Content:"Start"},
{Role:"assistant",Content:"Okay"},
},
thinkValue:&api.ThinkValue{Value:true},
expected:`<|begin▁of▁sentence|>Enable deep thinking subroutine.
You are Cogito, an AI assistant created by Deep Cogito, which is an AI research lab based in San Francisco.
{Role:"system",Content:"You are a pirate chatbot who always responds in pirate speak!"},
{Role:"user",Content:"Give me a short introduction to LLMs."},
{Role:"assistant",Content:"Arrr! I'm a pirate"},
{Role:"user",Content:"Tell me more about LLMs."},
},
thinkValue:&api.ThinkValue{Value:false},
expected:`<|begin▁of▁sentence|>You are Cogito, an AI assistant created by Deep Cogito, which is an AI research lab based in San Francisco.
You are a pirate chatbot who always responds in pirate speak!<|User|>Give me a short introduction to LLMs.<|Assistant|>Arrr! I'm a pirate<|end▁of▁sentence|><|User|>Tell me more about LLMs.<|Assistant|>`,
},
{
name:"multi_with_system2_thinking_true",
messages:[]api.Message{
{Role:"system",Content:"You are a pirate chatbot who always responds in pirate speak!"},
{Role:"user",Content:"Give me a short introduction to LLMs."},
{Role:"assistant",Content:"Arrr! I'm a pirate"},
{Role:"user",Content:"Tell me more about LLMs."},
},
thinkValue:&api.ThinkValue{Value:true},
expected:`<|begin▁of▁sentence|>Enable deep thinking subroutine.
You are Cogito, an AI assistant created by Deep Cogito, which is an AI research lab based in San Francisco.
You are a pirate chatbot who always responds in pirate speak!
<|User|>Give me a short introduction to LLMs.<|Assistant|>Arrr! I'm a pirate<|end▁of▁sentence|><|User|>Tell me more about LLMs.<|Assistant|><think>
`,
},
// tools
{
name:"tool_calls_only_no_content",
messages:[]api.Message{
{Role:"user",Content:"Get weather for Paris"},
{
Role:"assistant",
ToolCalls:[]api.ToolCall{
{
Function:api.ToolCallFunction{
Name:"get_weather",
Arguments:api.ToolCallFunctionArguments{
"location":"Paris",
},
},
},
},
},
},
thinkValue:&api.ThinkValue{Value:false},
expected:`<|begin▁of▁sentence|>You are Cogito, an AI assistant created by Deep Cogito, which is an AI research lab based in San Francisco.<|User|>Get weather for Paris<|Assistant|><|tool▁calls▁begin|><|tool▁call▁begin|>function<|tool▁sep|>get_weather
expected:`<|begin▁of▁sentence|>You are Cogito, an AI assistant created by Deep Cogito, which is an AI research lab based in San Francisco.<|User|>Process complex data<|Assistant|><|tool▁calls▁begin|><|tool▁call▁begin|>function<|tool▁sep|>process_data
expected:`<|begin▁of▁sentence|>You are Cogito, an AI assistant created by Deep Cogito, which is an AI research lab based in San Francisco.<|User|>Hello<|Assistant|><|end▁of▁sentence|><|Assistant|>`,
},
{
name:"thinking_with_empty_assistant_content",
messages:[]api.Message{
{Role:"user",Content:"Think about this"},
{Role:"assistant",Content:""},
},
thinkValue:&api.ThinkValue{Value:true},
expected:`<|begin▁of▁sentence|>Enable deep thinking subroutine.
You are Cogito, an AI assistant created by Deep Cogito, which is an AI research lab based in San Francisco.<|User|>Think about this<|Assistant|><|end▁of▁sentence|><|Assistant|><think>
`,
},
{
name:"multiple_system_messages",
messages:[]api.Message{
{Role:"system",Content:"First instruction"},
{Role:"system",Content:"Second instruction"},
{Role:"user",Content:"Hello"},
},
thinkValue:&api.ThinkValue{Value:false},
expected:`<|begin▁of▁sentence|>You are Cogito, an AI assistant created by Deep Cogito, which is an AI research lab based in San Francisco.
First instruction<|User|>Hello<|Assistant|>`,
},
{
name:"special_characters_in_content",
messages:[]api.Message{
{Role:"user",Content:"What about <|special|> tokens and \"quotes\"?"},
{Role:"assistant",Content:"They're handled normally in content."},
},
thinkValue:&api.ThinkValue{Value:false},
expected:`<|begin▁of▁sentence|>You are Cogito, an AI assistant created by Deep Cogito, which is an AI research lab based in San Francisco.<|User|>What about <|special|> tokens and "quotes"?<|Assistant|>They're handled normally in content.<|end▁of▁sentence|><|Assistant|>`,
},
{
name:"long_conversation_multiple_rounds",
messages:[]api.Message{
{Role:"user",Content:"Hi"},
{Role:"assistant",Content:"Hello!"},
{Role:"user",Content:"How are you?"},
{Role:"assistant",Content:"Good, thanks!"},
{Role:"user",Content:"What's the weather?"},
},
thinkValue:&api.ThinkValue{Value:false},
expected:`<|begin▁of▁sentence|>You are Cogito, an AI assistant created by Deep Cogito, which is an AI research lab based in San Francisco.<|User|>Hi<|Assistant|>Hello!<|end▁of▁sentence|><|User|>How are you?<|Assistant|>Good, thanks!<|end▁of▁sentence|><|User|>What's the weather?<|Assistant|>`,