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
6c8016e5
authored
Feb 25, 2025
by
1808837298@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: Add support for Claude thinking parameter in request
parent
c62276fc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
relay/channel/aws/dto.go
+2
-0
relay/channel/claude/dto.go
+9
-3
No files found.
relay/channel/aws/dto.go
View file @
6c8016e5
...
@@ -16,6 +16,7 @@ type AwsClaudeRequest struct {
...
@@ -16,6 +16,7 @@ type AwsClaudeRequest struct {
StopSequences
[]
string
`json:"stop_sequences,omitempty"`
StopSequences
[]
string
`json:"stop_sequences,omitempty"`
Tools
[]
claude
.
Tool
`json:"tools,omitempty"`
Tools
[]
claude
.
Tool
`json:"tools,omitempty"`
ToolChoice
any
`json:"tool_choice,omitempty"`
ToolChoice
any
`json:"tool_choice,omitempty"`
Thinking
*
claude
.
Thinking
`json:"thinking,omitempty"`
}
}
func
copyRequest
(
req
*
claude
.
ClaudeRequest
)
*
AwsClaudeRequest
{
func
copyRequest
(
req
*
claude
.
ClaudeRequest
)
*
AwsClaudeRequest
{
...
@@ -30,5 +31,6 @@ func copyRequest(req *claude.ClaudeRequest) *AwsClaudeRequest {
...
@@ -30,5 +31,6 @@ func copyRequest(req *claude.ClaudeRequest) *AwsClaudeRequest {
StopSequences
:
req
.
StopSequences
,
StopSequences
:
req
.
StopSequences
,
Tools
:
req
.
Tools
,
Tools
:
req
.
Tools
,
ToolChoice
:
req
.
ToolChoice
,
ToolChoice
:
req
.
ToolChoice
,
Thinking
:
req
.
Thinking
,
}
}
}
}
relay/channel/claude/dto.go
View file @
6c8016e5
...
@@ -54,9 +54,15 @@ type ClaudeRequest struct {
...
@@ -54,9 +54,15 @@ type ClaudeRequest struct {
TopP
float64
`json:"top_p,omitempty"`
TopP
float64
`json:"top_p,omitempty"`
TopK
int
`json:"top_k,omitempty"`
TopK
int
`json:"top_k,omitempty"`
//ClaudeMetadata `json:"metadata,omitempty"`
//ClaudeMetadata `json:"metadata,omitempty"`
Stream
bool
`json:"stream,omitempty"`
Stream
bool
`json:"stream,omitempty"`
Tools
[]
Tool
`json:"tools,omitempty"`
Tools
[]
Tool
`json:"tools,omitempty"`
ToolChoice
any
`json:"tool_choice,omitempty"`
ToolChoice
any
`json:"tool_choice,omitempty"`
Thinking
*
Thinking
`json:"thinking,omitempty"`
}
type
Thinking
struct
{
Type
string
`json:"type"`
BudgetTokens
int
`json:"budget_tokens"`
}
}
type
ClaudeError
struct
{
type
ClaudeError
struct
{
...
...
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