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
0d16a06c
authored
Nov 18, 2025
by
CaIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: aws
parent
70b61425
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
relay/channel/aws/dto.go
+12
-7
No files found.
relay/channel/aws/dto.go
View file @
0d16a06c
package
aws
package
aws
import
(
import
(
"context"
"encoding/json"
"encoding/json"
"io"
"io"
"net/http"
"net/http"
"strings"
"github.com/QuantumNous/new-api/common"
"github.com/QuantumNous/new-api/common"
"github.com/QuantumNous/new-api/dto"
"github.com/QuantumNous/new-api/dto"
"github.com/QuantumNous/new-api/logger"
)
)
type
AwsClaudeRequest
struct
{
type
AwsClaudeRequest
struct
{
...
@@ -34,17 +37,19 @@ func formatRequest(requestBody io.Reader, requestHeader http.Header) (*AwsClaude
...
@@ -34,17 +37,19 @@ func formatRequest(requestBody io.Reader, requestHeader http.Header) (*AwsClaude
awsClaudeRequest
.
AnthropicVersion
=
"bedrock-2023-05-31"
awsClaudeRequest
.
AnthropicVersion
=
"bedrock-2023-05-31"
// check header anthropic-beta
// check header anthropic-beta
anthropicBetaValues
:=
requestHeader
.
Values
(
"anthropic-beta"
)
anthropicBetaValues
:=
requestHeader
.
Get
(
"anthropic-beta"
)
if
len
(
anthropicBetaValues
)
>
0
{
if
len
(
anthropicBetaValues
)
>
0
{
betaJson
,
err
:=
json
.
Marshal
(
anthropicBetaValues
)
if
err
!=
nil
{
return
nil
,
err
}
var
tempArray
[]
string
var
tempArray
[]
string
if
err
:=
json
.
Unmarshal
(
betaJson
,
&
tempArray
);
err
==
nil
&&
len
(
tempArray
)
!=
0
&&
len
(
betaJson
)
>
0
{
tempArray
=
strings
.
Split
(
anthropicBetaValues
,
","
)
awsClaudeRequest
.
AnthropicBeta
=
json
.
RawMessage
(
betaJson
)
if
len
(
tempArray
)
>
0
{
betaJson
,
err
:=
json
.
Marshal
(
tempArray
)
if
err
!=
nil
{
return
nil
,
err
}
awsClaudeRequest
.
AnthropicBeta
=
betaJson
}
}
}
}
logger
.
LogJson
(
context
.
Background
(),
"json"
,
awsClaudeRequest
)
return
&
awsClaudeRequest
,
nil
return
&
awsClaudeRequest
,
nil
}
}
...
...
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