Unverified Commit 6c3faafe authored by Devon Rifkin's avatar Devon Rifkin Committed by GitHub
Browse files

olmo3: fix flaky test (#13629)

I introduced this in <https://github.com/ollama/ollama/pull/13525>
parent e51dead6
......@@ -227,9 +227,9 @@ func TestOlmo3Renderer(t *testing.T) {
ID: "call_1",
Function: api.ToolCallFunction{
Name: "book_flight",
Arguments: testArgs(map[string]any{
"from": "SFO",
"to": "NYC",
Arguments: testArgsOrdered([]orderedArg{
{"from", "SFO"},
{"to", "NYC"},
}),
},
},
......@@ -243,9 +243,9 @@ func TestOlmo3Renderer(t *testing.T) {
Name: "book_flight",
Parameters: api.ToolFunctionParameters{
Type: "object",
Properties: testPropsMap(map[string]api.ToolProperty{
"from": {Type: api.PropertyType{"string"}},
"to": {Type: api.PropertyType{"string"}},
Properties: testPropsOrdered([]orderedProp{
{"from", api.ToolProperty{Type: api.PropertyType{"string"}}},
{"to", api.ToolProperty{Type: api.PropertyType{"string"}}},
}),
},
},
......
......@@ -34,3 +34,18 @@ func testArgsOrdered(pairs []orderedArg) api.ToolCallFunctionArguments {
}
return args
}
// orderedProp represents a key-value pair for ordered property creation
type orderedProp struct {
Key string
Value api.ToolProperty
}
// testPropsOrdered creates a ToolPropertiesMap with a specific key order
func testPropsOrdered(pairs []orderedProp) *api.ToolPropertiesMap {
props := api.NewToolPropertiesMap()
for _, p := range pairs {
props.Set(p.Key, p.Value)
}
return props
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment