feat: live-validated against Ollama Cloud; schema instruction fallback for cloud
Phase 8: all six live checks pass (tier aliases, thinking-tier chat, real tool invocation, structured Generate[T], forced failover with bench+skip, skill agent). Discovery: ollama.com ignores the format field — the provider now also states the schema as a system instruction (constrained decoding locally, instruction-guided JSON on cloud), with hermetic test. Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
@@ -235,6 +235,14 @@ func TestStructuredOutputFormat(t *testing.T) {
|
||||
if resp.Text() != `{"name":"Ada"}` {
|
||||
t.Errorf("text = %q", resp.Text())
|
||||
}
|
||||
// Ollama Cloud ignores "format", so the schema must also be stated as
|
||||
// a system instruction.
|
||||
msgs := cap.body["messages"].([]any)
|
||||
sys := msgs[0].(map[string]any)
|
||||
if sys["role"] != "system" || !strings.Contains(sys["content"].(string), `"name"`) ||
|
||||
!strings.Contains(sys["content"].(string), "JSON Schema") {
|
||||
t.Errorf("system fold must carry the schema instruction, got %v", sys)
|
||||
}
|
||||
}
|
||||
|
||||
func TestThinkMapping(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user