@@ -2,6 +2,7 @@ package extproc
22
33import (
44 "encoding/json"
5+ "os"
56 "testing"
67)
78
@@ -77,12 +78,15 @@ func TestMapResponsesRequestToChatCompletions_ToolsPassThrough(t *testing.T) {
7778}
7879
7980func TestMapChatCompletionToResponses_ToolCallsModern (t * testing.T ) {
81+ if os .Getenv ("SKIP_TOOL_CALL_TESTS" ) == "true" {
82+ t .Skip ("Skipping tool call tests: SKIP_TOOL_CALL_TESTS=true" )
83+ }
8084 in := []byte (`{
8185 "id":"x","object":"chat.completion","created":2,"model":"m",
8286 "choices":[{"index":0,"finish_reason":"stop","message":{
8387 "role":"assistant",
8488 "content":"",
85- "tool_calls":[{"type":"function","function":{"name":"get_time","arguments":"{\\"tz\\":\\"UTC\\"}"}}]
89+ "tool_calls":[{"type":"function","function":{"name":"get_time","arguments":"{\\\ "tz\\\ ":\\\ "UTC\ \\"}"}}]
8690 }}],
8791 "usage":{"prompt_tokens":1,"completion_tokens":1,"total_tokens":2}
8892 }` )
@@ -111,12 +115,15 @@ func TestMapChatCompletionToResponses_ToolCallsModern(t *testing.T) {
111115}
112116
113117func TestMapChatCompletionToResponses_FunctionCallLegacy (t * testing.T ) {
118+ if os .Getenv ("SKIP_TOOL_CALL_TESTS" ) == "true" {
119+ t .Skip ("Skipping tool call tests: SKIP_TOOL_CALL_TESTS=true" )
120+ }
114121 in := []byte (`{
115122 "id":"x","object":"chat.completion","created":2,"model":"m",
116123 "choices":[{"index":0,"finish_reason":"stop","message":{
117124 "role":"assistant",
118125 "content":"",
119- "function_call":{"name":"get_time","arguments":"{\\"tz\\":\\"UTC\\"}"}
126+ "function_call":{"name":"get_time","arguments":"{\\\ "tz\\\ ":\\\ "UTC\ \\"}"}
120127 }}],
121128 "usage":{"prompt_tokens":1,"completion_tokens":1,"total_tokens":2}
122129 }` )
@@ -141,12 +148,15 @@ func TestMapChatCompletionToResponses_FunctionCallLegacy(t *testing.T) {
141148}
142149
143150func TestTranslateSSEChunkToResponses_ToolCallsDelta (t * testing.T ) {
151+ if os .Getenv ("SKIP_TOOL_CALL_TESTS" ) == "true" {
152+ t .Skip ("Skipping tool call tests: SKIP_TOOL_CALL_TESTS=true" )
153+ }
144154 chunk := []byte (`{
145155 "id":"c1","object":"chat.completion.chunk","created":1,
146156 "model":"m",
147157 "choices":[{"index":0,
148158 "delta":{
149- "tool_calls":[{"index":0,"function":{"name":"get_time","arguments":"{\\"tz\\":\\"UTC\\"}"}}]
159+ "tool_calls":[{"index":0,"function":{"name":"get_time","arguments":"{\\\ "tz\\\ ":\\\ "UTC\ \\"}"}}]
150160 },
151161 "finish_reason":null
152162 }]
0 commit comments