File tree Expand file tree Collapse file tree
internal/plugins/backends/openaicompat Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -129,7 +129,9 @@ func TestNewBackend_forwardsRequestAndClientOptions(t *testing.T) {
129129 })
130130
131131 spec := validBackendSpec (srv .URL )
132- spec .ClientOptions = func (lipapi.Call , routing.AttemptCandidate ) []option.RequestOption {
132+ var gotCand routing.AttemptCandidate
133+ spec .ClientOptions = func (_ lipapi.Call , cand routing.AttemptCandidate ) []option.RequestOption {
134+ gotCand = cand
133135 return []option.RequestOption {option .WithHeader ("X-Test-Client" , "yes" )}
134136 }
135137 spec .RequestOptions = func (lipapi.Call ) []option.RequestOption {
@@ -149,6 +151,9 @@ func TestNewBackend_forwardsRequestAndClientOptions(t *testing.T) {
149151 if header != "yes" {
150152 t .Fatalf ("client header = %q" , header )
151153 }
154+ if gotCand .Primary .Model != "gpt-test" {
155+ t .Fatalf ("candidate model = %q, want gpt-test" , gotCand .Primary .Model )
156+ }
152157 body := rec .lastBody (t )
153158 if ! strings .Contains (string (body ), `"max_tokens":19` ) {
154159 t .Fatalf ("request option not applied body=%s" , string (body ))
You can’t perform that action at this time.
0 commit comments