First Commit
ci / go (push) Waiting to run
ci / go-db (agent) (push) Waiting to run
ci / go-db (config) (push) Waiting to run
ci / go-db (db) (push) Waiting to run
ci / go-db (evidence) (push) Waiting to run
ci / go-db (llmrec) (push) Waiting to run
ci / go-db (server) (push) Waiting to run
web / web (push) Waiting to run
docs / links (push) Canceled after 0s
detections / detections (push) Canceled after 0s
ci / go (push) Waiting to run
ci / go-db (agent) (push) Waiting to run
ci / go-db (config) (push) Waiting to run
ci / go-db (db) (push) Waiting to run
ci / go-db (evidence) (push) Waiting to run
ci / go-db (llmrec) (push) Waiting to run
ci / go-db (server) (push) Waiting to run
web / web (push) Waiting to run
docs / links (push) Canceled after 0s
detections / detections (push) Canceled after 0s
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
package agent
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/Autumn-27/norma/llm"
|
||||
)
|
||||
|
||||
// TestConfigFromOpenAIResponses locks the openai-responses format wiring:
|
||||
// ConfigFrom resolves the Responses format, strips a full /responses endpoint
|
||||
// back to the API base, and Provider() round-trips the short name. NewProvider
|
||||
// must build a working provider for it.
|
||||
func TestConfigFromOpenAIResponses(t *testing.T) {
|
||||
c := ConfigFrom("openai-responses", "gpt-5", "https://gw.example/v1/responses", "sk-x", "")
|
||||
if c.Format != llm.FormatOpenAIResponses {
|
||||
t.Fatalf("format=%v, want FormatOpenAIResponses", c.Format)
|
||||
}
|
||||
if c.BaseURL != "https://gw.example/v1" {
|
||||
t.Fatalf("base_url=%q, want the /responses suffix stripped", c.BaseURL)
|
||||
}
|
||||
if c.Provider() != "openai-responses" {
|
||||
t.Fatalf("Provider()=%q", c.Provider())
|
||||
}
|
||||
if !c.Stream { // default streaming preserved
|
||||
t.Fatal("Stream should default true")
|
||||
}
|
||||
if _, err := c.NewProvider(); err != nil {
|
||||
t.Fatalf("NewProvider: %v", err)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user