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
48b94dd2
authored
Dec 20, 2023
by
CaIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update GeneralOpenAIRequest
parent
f74a89fc
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
8 additions
and
8 deletions
+8
-8
controller/relay-claude.go
+1
-1
controller/relay-gemini.go
+1
-1
controller/relay-palm.go
+1
-1
controller/relay-text.go
+1
-1
controller/relay-xunfei.go
+1
-1
controller/relay.go
+3
-3
No files found.
controller/relay-claude.go
View file @
48b94dd2
...
@@ -18,7 +18,7 @@ type ClaudeMetadata struct {
...
@@ -18,7 +18,7 @@ type ClaudeMetadata struct {
type
ClaudeRequest
struct
{
type
ClaudeRequest
struct
{
Model
string
`json:"model"`
Model
string
`json:"model"`
Prompt
string
`json:"prompt"`
Prompt
string
`json:"prompt"`
MaxTokensToSample
int
`json:"max_tokens_to_sample"`
MaxTokensToSample
uint
`json:"max_tokens_to_sample"`
StopSequences
[]
string
`json:"stop_sequences,omitempty"`
StopSequences
[]
string
`json:"stop_sequences,omitempty"`
Temperature
float64
`json:"temperature,omitempty"`
Temperature
float64
`json:"temperature,omitempty"`
TopP
float64
`json:"top_p,omitempty"`
TopP
float64
`json:"top_p,omitempty"`
...
...
controller/relay-gemini.go
View file @
48b94dd2
...
@@ -47,7 +47,7 @@ type GeminiChatGenerationConfig struct {
...
@@ -47,7 +47,7 @@ type GeminiChatGenerationConfig struct {
Temperature
float64
`json:"temperature,omitempty"`
Temperature
float64
`json:"temperature,omitempty"`
TopP
float64
`json:"topP,omitempty"`
TopP
float64
`json:"topP,omitempty"`
TopK
float64
`json:"topK,omitempty"`
TopK
float64
`json:"topK,omitempty"`
MaxOutputTokens
int
`json:"maxOutputTokens,omitempty"`
MaxOutputTokens
uint
`json:"maxOutputTokens,omitempty"`
CandidateCount
int
`json:"candidateCount,omitempty"`
CandidateCount
int
`json:"candidateCount,omitempty"`
StopSequences
[]
string
`json:"stopSequences,omitempty"`
StopSequences
[]
string
`json:"stopSequences,omitempty"`
}
}
...
...
controller/relay-palm.go
View file @
48b94dd2
...
@@ -31,7 +31,7 @@ type PaLMChatRequest struct {
...
@@ -31,7 +31,7 @@ type PaLMChatRequest struct {
Temperature
float64
`json:"temperature,omitempty"`
Temperature
float64
`json:"temperature,omitempty"`
CandidateCount
int
`json:"candidateCount,omitempty"`
CandidateCount
int
`json:"candidateCount,omitempty"`
TopP
float64
`json:"topP,omitempty"`
TopP
float64
`json:"topP,omitempty"`
TopK
int
`json:"topK,omitempty"`
TopK
uint
`json:"topK,omitempty"`
}
}
type
PaLMError
struct
{
type
PaLMError
struct
{
...
...
controller/relay-text.go
View file @
48b94dd2
...
@@ -233,7 +233,7 @@ func relayTextHelper(c *gin.Context, relayMode int) *OpenAIErrorWithStatusCode {
...
@@ -233,7 +233,7 @@ func relayTextHelper(c *gin.Context, relayMode int) *OpenAIErrorWithStatusCode {
}
}
preConsumedTokens
:=
common
.
PreConsumedQuota
preConsumedTokens
:=
common
.
PreConsumedQuota
if
textRequest
.
MaxTokens
!=
0
{
if
textRequest
.
MaxTokens
!=
0
{
preConsumedTokens
=
promptTokens
+
textRequest
.
MaxTokens
preConsumedTokens
=
promptTokens
+
int
(
textRequest
.
MaxTokens
)
}
}
modelRatio
:=
common
.
GetModelRatio
(
textRequest
.
Model
)
modelRatio
:=
common
.
GetModelRatio
(
textRequest
.
Model
)
groupRatio
:=
common
.
GetGroupRatio
(
group
)
groupRatio
:=
common
.
GetGroupRatio
(
group
)
...
...
controller/relay-xunfei.go
View file @
48b94dd2
...
@@ -33,7 +33,7 @@ type XunfeiChatRequest struct {
...
@@ -33,7 +33,7 @@ type XunfeiChatRequest struct {
Domain
string
`json:"domain,omitempty"`
Domain
string
`json:"domain,omitempty"`
Temperature
float64
`json:"temperature,omitempty"`
Temperature
float64
`json:"temperature,omitempty"`
TopK
int
`json:"top_k,omitempty"`
TopK
int
`json:"top_k,omitempty"`
MaxTokens
int
`json:"max_tokens,omitempty"`
MaxTokens
uint
`json:"max_tokens,omitempty"`
Auditing
bool
`json:"auditing,omitempty"`
Auditing
bool
`json:"auditing,omitempty"`
}
`json:"chat"`
}
`json:"chat"`
}
`json:"parameter"`
}
`json:"parameter"`
...
...
controller/relay.go
View file @
48b94dd2
...
@@ -53,7 +53,7 @@ type GeneralOpenAIRequest struct {
...
@@ -53,7 +53,7 @@ type GeneralOpenAIRequest struct {
Messages
[]
Message
`json:"messages,omitempty"`
Messages
[]
Message
`json:"messages,omitempty"`
Prompt
any
`json:"prompt,omitempty"`
Prompt
any
`json:"prompt,omitempty"`
Stream
bool
`json:"stream,omitempty"`
Stream
bool
`json:"stream,omitempty"`
MaxTokens
int
`json:"max_tokens,omitempty"`
MaxTokens
uint
`json:"max_tokens,omitempty"`
Temperature
float64
`json:"temperature,omitempty"`
Temperature
float64
`json:"temperature,omitempty"`
TopP
float64
`json:"top_p,omitempty"`
TopP
float64
`json:"top_p,omitempty"`
N
int
`json:"n,omitempty"`
N
int
`json:"n,omitempty"`
...
@@ -91,14 +91,14 @@ type AudioRequest struct {
...
@@ -91,14 +91,14 @@ type AudioRequest struct {
type
ChatRequest
struct
{
type
ChatRequest
struct
{
Model
string
`json:"model"`
Model
string
`json:"model"`
Messages
[]
Message
`json:"messages"`
Messages
[]
Message
`json:"messages"`
MaxTokens
int
`json:"max_tokens"`
MaxTokens
uint
`json:"max_tokens"`
}
}
type
TextRequest
struct
{
type
TextRequest
struct
{
Model
string
`json:"model"`
Model
string
`json:"model"`
Messages
[]
Message
`json:"messages"`
Messages
[]
Message
`json:"messages"`
Prompt
string
`json:"prompt"`
Prompt
string
`json:"prompt"`
MaxTokens
int
`json:"max_tokens"`
MaxTokens
uint
`json:"max_tokens"`
//Stream bool `json:"stream"`
//Stream bool `json:"stream"`
}
}
...
...
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