Showing the changes to test (1 of 1 file). Show all
Unified · Split
| @@ -33,7 +33,7 @@ func TestOpenAIToCodex_PreservesBuiltinTools(t *testing.T) { · 32 unmodified lines | |||
| 33 | } | 33 | } |
| 34 | } | 34 | } |
| 35 | 35 | ||
| 36 | func TestOpenAIResponsesToOpenAI_PreservesBuiltinTools(t *testing.T) { | 36 | func TestOpenAIResponsesToOpenAI_IgnoresBuiltinTools(t *testing.T) { |
| 37 | in := []byte(`{ | 37 | in := []byte(`{ |
| 38 | "model":"gpt-5", | 38 | "model":"gpt-5", |
| 39 | "input":[{"role":"user","content":[{"type":"input_text","text":"hi"}]}], | 39 | "input":[{"role":"user","content":[{"type":"input_text","text":"hi"}]}], |
| @@ -42,13 +42,7 @@ func TestOpenAIResponsesToOpenAI_PreservesBuiltinTools(t *testing.T) { · 2 unmodified lines | |||
| 42 | 42 | ||
| 43 | out := sdktranslator.TranslateRequest(sdktranslator.FormatOpenAIResponse, sdktranslator.FormatOpenAI, "gpt-5", in, false) | 43 | out := sdktranslator.TranslateRequest(sdktranslator.FormatOpenAIResponse, sdktranslator.FormatOpenAI, "gpt-5", in, false) |
| 44 | 44 | ||
| 45 | if got := gjson.GetBytes(out, "tools.#").Int(); got != 1 { | 45 | if got := gjson.GetBytes(out, "tools.#").Int(); got != 0 { |
| 46 | t.Fatalf("expected 1 tool, got %d: %s", got, string(out)) | 46 | t.Fatalf("expected 0 tools (builtin tools not supported in Chat Completions), got %d: %s", got, string(out)) |
| 47 | } | ||
| 48 | if got := gjson.GetBytes(out, "tools.0.type").String(); got != "web_search" { | ||
| 49 | t.Fatalf("expected tools[0].type=web_search, got %q: %s", got, string(out)) | ||
| 50 | } | ||
| 51 | if got := gjson.GetBytes(out, "tools.0.search_context_size").String(); got != "low" { | ||
| 52 | t.Fatalf("expected tools[0].search_context_size=low, got %q: %s", got, string(out)) | ||
| 53 | } | 47 | } |
| 54 | } | 48 | } |