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
17c8ba78
authored
Sep 11, 2024
by
CalciumIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: claude response return model name
parent
f50cf75d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
0 deletions
+2
-0
dto/text_response.go
+1
-0
relay/channel/claude/relay-claude.go
+1
-0
No files found.
dto/text_response.go
View file @
17c8ba78
...
@@ -34,6 +34,7 @@ type OpenAITextResponseChoice struct {
...
@@ -34,6 +34,7 @@ type OpenAITextResponseChoice struct {
type
OpenAITextResponse
struct
{
type
OpenAITextResponse
struct
{
Id
string
`json:"id"`
Id
string
`json:"id"`
Model
string
`json:"model"`
Object
string
`json:"object"`
Object
string
`json:"object"`
Created
int64
`json:"created"`
Created
int64
`json:"created"`
Choices
[]
OpenAITextResponseChoice
`json:"choices"`
Choices
[]
OpenAITextResponseChoice
`json:"choices"`
...
...
relay/channel/claude/relay-claude.go
View file @
17c8ba78
...
@@ -341,6 +341,7 @@ func ResponseClaude2OpenAI(reqMode int, claudeResponse *ClaudeResponse) *dto.Ope
...
@@ -341,6 +341,7 @@ func ResponseClaude2OpenAI(reqMode int, claudeResponse *ClaudeResponse) *dto.Ope
if
len
(
tools
)
>
0
{
if
len
(
tools
)
>
0
{
choice
.
Message
.
ToolCalls
=
tools
choice
.
Message
.
ToolCalls
=
tools
}
}
fullTextResponse
.
Model
=
claudeResponse
.
Model
choices
=
append
(
choices
,
choice
)
choices
=
append
(
choices
,
choice
)
fullTextResponse
.
Choices
=
choices
fullTextResponse
.
Choices
=
choices
return
&
fullTextResponse
return
&
fullTextResponse
...
...
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