Add reasoning effort to usage events
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
package auth
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
cliproxyexecutor "github.com/router-for-me/CLIProxyAPI/v7/sdk/cliproxy/executor"
|
||||
coreusage "github.com/router-for-me/CLIProxyAPI/v7/sdk/cliproxy/usage"
|
||||
)
|
||||
|
||||
func TestContextWithRequestedModelAliasIncludesReasoningEffort(t *testing.T) {
|
||||
ctx := contextWithRequestedModelAlias(context.Background(), cliproxyexecutor.Options{
|
||||
Metadata: map[string]any{
|
||||
cliproxyexecutor.RequestedModelMetadataKey: "client-model",
|
||||
cliproxyexecutor.ReasoningEffortMetadataKey: "medium",
|
||||
},
|
||||
}, "fallback-model")
|
||||
|
||||
if got := coreusage.RequestedModelAliasFromContext(ctx); got != "client-model" {
|
||||
t.Fatalf("requested model alias = %q, want %q", got, "client-model")
|
||||
}
|
||||
if got := coreusage.ReasoningEffortFromContext(ctx); got != "medium" {
|
||||
t.Fatalf("reasoning effort = %q, want %q", got, "medium")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user