Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
502858d3
authored
Jun 17, 2026
by
skynono
Committed by
GitHub
Jun 17, 2026
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 工具调用 arguments 为空时保留 tool_use 块 (#5543)
parent
8d87d5fd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
relay/channel/claude/relay-claude.go
+4
-3
No files found.
relay/channel/claude/relay-claude.go
View file @
502858d3
...
@@ -410,9 +410,10 @@ func RequestOpenAI2ClaudeMessage(c *gin.Context, textRequest dto.GeneralOpenAIRe
...
@@ -410,9 +410,10 @@ func RequestOpenAI2ClaudeMessage(c *gin.Context, textRequest dto.GeneralOpenAIRe
if
message
.
ToolCalls
!=
nil
{
if
message
.
ToolCalls
!=
nil
{
for
_
,
toolCall
:=
range
message
.
ParseToolCalls
()
{
for
_
,
toolCall
:=
range
message
.
ParseToolCalls
()
{
inputObj
:=
make
(
map
[
string
]
any
)
inputObj
:=
make
(
map
[
string
]
any
)
if
err
:=
json
.
Unmarshal
([]
byte
(
toolCall
.
Function
.
Arguments
),
&
inputObj
);
err
!=
nil
{
if
args
:=
toolCall
.
Function
.
Arguments
;
args
!=
""
{
common
.
SysLog
(
"tool call function arguments is not a map[string]any: "
+
fmt
.
Sprintf
(
"%v"
,
toolCall
.
Function
.
Arguments
))
if
err
:=
json
.
Unmarshal
([]
byte
(
args
),
&
inputObj
);
err
!=
nil
{
continue
common
.
SysLog
(
"tool call function arguments is not a map[string]any: "
+
fmt
.
Sprintf
(
"%v"
,
toolCall
.
Function
.
Arguments
))
}
}
}
claudeMediaMessages
=
append
(
claudeMediaMessages
,
dto
.
ClaudeMediaMessage
{
claudeMediaMessages
=
append
(
claudeMediaMessages
,
dto
.
ClaudeMediaMessage
{
Type
:
"tool_use"
,
Type
:
"tool_use"
,
...
...
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