Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
陈曦
sub2api
Commits
d978ac97
Unverified
Commit
d978ac97
authored
Apr 01, 2026
by
YanzheL
Browse files
test(antigravity): cover mixed web search transforms
parent
dd5978f2
Changes
1
Hide whitespace changes
Inline
Side-by-side
backend/internal/pkg/antigravity/request_transformer_test.go
View file @
d978ac97
...
@@ -423,3 +423,36 @@ func TestTransformClaudeToGeminiWithOptions_PreservesBillingHeaderSystemBlock(t
...
@@ -423,3 +423,36 @@ func TestTransformClaudeToGeminiWithOptions_PreservesBillingHeaderSystemBlock(t
})
})
}
}
}
}
func
TestTransformClaudeToGeminiWithOptions_PreservesWebSearchAlongsideFunctions
(
t
*
testing
.
T
)
{
claudeReq
:=
&
ClaudeRequest
{
Model
:
"claude-3-5-sonnet-latest"
,
Messages
:
[]
ClaudeMessage
{
{
Role
:
"user"
,
Content
:
json
.
RawMessage
(
`[{"type":"text","text":"hello"}]`
),
},
},
Tools
:
[]
ClaudeTool
{
{
Name
:
"get_weather"
,
Description
:
"Get weather information"
,
InputSchema
:
map
[
string
]
any
{
"type"
:
"object"
},
},
{
Type
:
"web_search_20250305"
,
Name
:
"web_search"
,
},
},
}
body
,
err
:=
TransformClaudeToGeminiWithOptions
(
claudeReq
,
"project-1"
,
"gemini-2.5-flash"
,
DefaultTransformOptions
())
require
.
NoError
(
t
,
err
)
var
req
V1InternalRequest
require
.
NoError
(
t
,
json
.
Unmarshal
(
body
,
&
req
))
require
.
Len
(
t
,
req
.
Request
.
Tools
,
2
)
require
.
Len
(
t
,
req
.
Request
.
Tools
[
0
]
.
FunctionDeclarations
,
1
)
require
.
Equal
(
t
,
"get_weather"
,
req
.
Request
.
Tools
[
0
]
.
FunctionDeclarations
[
0
]
.
Name
)
require
.
NotNil
(
t
,
req
.
Request
.
Tools
[
1
]
.
GoogleSearch
)
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment