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
Commit
be047a70
authored
Dec 24, 2025
by
Seefs
Committed by
GitHub
Dec 24, 2025
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2511 from JerryKwan/issue2499
parents
8ee5c23b
2504e9ad
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
19 deletions
+23
-19
service/convert.go
+23
-19
No files found.
service/convert.go
View file @
be047a70
...
...
@@ -389,25 +389,29 @@ func StreamResponseOpenAI2Claude(openAIResponse *dto.ChatCompletionsStreamRespon
}
idx
:=
blockIndex
claudeResponses
=
append
(
claudeResponses
,
&
dto
.
ClaudeResponse
{
Index
:
&
idx
,
Type
:
"content_block_start"
,
ContentBlock
:
&
dto
.
ClaudeMediaMessage
{
Id
:
toolCall
.
ID
,
Type
:
"tool_use"
,
Name
:
toolCall
.
Function
.
Name
,
Input
:
map
[
string
]
interface
{}{},
},
})
claudeResponses
=
append
(
claudeResponses
,
&
dto
.
ClaudeResponse
{
Index
:
&
idx
,
Type
:
"content_block_delta"
,
Delta
:
&
dto
.
ClaudeMediaMessage
{
Type
:
"input_json_delta"
,
PartialJson
:
&
toolCall
.
Function
.
Arguments
,
},
})
if
toolCall
.
Function
.
Name
!=
""
{
claudeResponses
=
append
(
claudeResponses
,
&
dto
.
ClaudeResponse
{
Index
:
&
idx
,
Type
:
"content_block_start"
,
ContentBlock
:
&
dto
.
ClaudeMediaMessage
{
Id
:
toolCall
.
ID
,
Type
:
"tool_use"
,
Name
:
toolCall
.
Function
.
Name
,
Input
:
map
[
string
]
interface
{}{},
},
})
}
if
len
(
toolCall
.
Function
.
Arguments
)
>
0
{
claudeResponses
=
append
(
claudeResponses
,
&
dto
.
ClaudeResponse
{
Index
:
&
idx
,
Type
:
"content_block_delta"
,
Delta
:
&
dto
.
ClaudeMediaMessage
{
Type
:
"input_json_delta"
,
PartialJson
:
&
toolCall
.
Function
.
Arguments
,
},
})
}
info
.
ClaudeConvertInfo
.
Index
=
blockIndex
}
...
...
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