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
2fb222b9
authored
Jun 08, 2025
by
CaIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor(dto): change function and encoding fields to use json.RawMessage for improved flexibility
parent
2b3e64e8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
11 deletions
+5
-11
dto/openai_request.go
+5
-5
relay/channel/gemini/relay-gemini.go
+0
-6
No files found.
dto/openai_request.go
View file @
2fb222b9
...
@@ -37,11 +37,11 @@ type GeneralOpenAIRequest struct {
...
@@ -37,11 +37,11 @@ type GeneralOpenAIRequest struct {
Input
any
`json:"input,omitempty"`
Input
any
`json:"input,omitempty"`
Instruction
string
`json:"instruction,omitempty"`
Instruction
string
`json:"instruction,omitempty"`
Size
string
`json:"size,omitempty"`
Size
string
`json:"size,omitempty"`
Functions
any
`json:"functions,omitempty"`
Functions
json
.
RawMessage
`json:"functions,omitempty"`
FrequencyPenalty
float64
`json:"frequency_penalty,omitempty"`
FrequencyPenalty
float64
`json:"frequency_penalty,omitempty"`
PresencePenalty
float64
`json:"presence_penalty,omitempty"`
PresencePenalty
float64
`json:"presence_penalty,omitempty"`
ResponseFormat
*
ResponseFormat
`json:"response_format,omitempty"`
ResponseFormat
*
ResponseFormat
`json:"response_format,omitempty"`
EncodingFormat
any
`json:"encoding_format,omitempty"`
EncodingFormat
json
.
RawMessage
`json:"encoding_format,omitempty"`
Seed
float64
`json:"seed,omitempty"`
Seed
float64
`json:"seed,omitempty"`
ParallelTooCalls
*
bool
`json:"parallel_tool_calls,omitempty"`
ParallelTooCalls
*
bool
`json:"parallel_tool_calls,omitempty"`
Tools
[]
ToolCallRequest
`json:"tools,omitempty"`
Tools
[]
ToolCallRequest
`json:"tools,omitempty"`
...
@@ -50,10 +50,10 @@ type GeneralOpenAIRequest struct {
...
@@ -50,10 +50,10 @@ type GeneralOpenAIRequest struct {
LogProbs
bool
`json:"logprobs,omitempty"`
LogProbs
bool
`json:"logprobs,omitempty"`
TopLogProbs
int
`json:"top_logprobs,omitempty"`
TopLogProbs
int
`json:"top_logprobs,omitempty"`
Dimensions
int
`json:"dimensions,omitempty"`
Dimensions
int
`json:"dimensions,omitempty"`
Modalities
any
`json:"modalities,omitempty"`
Modalities
json
.
RawMessage
`json:"modalities,omitempty"`
Audio
any
`json:"audio,omitempty"`
Audio
json
.
RawMessage
`json:"audio,omitempty"`
EnableThinking
any
`json:"enable_thinking,omitempty"`
// ali
EnableThinking
any
`json:"enable_thinking,omitempty"`
// ali
ExtraBody
any
`json:"extra_body,omitempty"`
ExtraBody
json
.
RawMessage
`json:"extra_body,omitempty"`
WebSearchOptions
*
WebSearchOptions
`json:"web_search_options,omitempty"`
WebSearchOptions
*
WebSearchOptions
`json:"web_search_options,omitempty"`
// OpenRouter Params
// OpenRouter Params
Reasoning
json
.
RawMessage
`json:"reasoning,omitempty"`
Reasoning
json
.
RawMessage
`json:"reasoning,omitempty"`
...
...
relay/channel/gemini/relay-gemini.go
View file @
2fb222b9
...
@@ -175,12 +175,6 @@ func CovertGemini2OpenAI(textRequest dto.GeneralOpenAIRequest, info *relaycommon
...
@@ -175,12 +175,6 @@ func CovertGemini2OpenAI(textRequest dto.GeneralOpenAIRequest, info *relaycommon
// common.SysLog("tools: " + fmt.Sprintf("%+v", geminiRequest.Tools))
// common.SysLog("tools: " + fmt.Sprintf("%+v", geminiRequest.Tools))
// json_data, _ := json.Marshal(geminiRequest.Tools)
// json_data, _ := json.Marshal(geminiRequest.Tools)
// common.SysLog("tools_json: " + string(json_data))
// common.SysLog("tools_json: " + string(json_data))
}
else
if
textRequest
.
Functions
!=
nil
{
//geminiRequest.Tools = []GeminiChatTool{
// {
// FunctionDeclarations: textRequest.Functions,
// },
//}
}
}
if
textRequest
.
ResponseFormat
!=
nil
&&
(
textRequest
.
ResponseFormat
.
Type
==
"json_schema"
||
textRequest
.
ResponseFormat
.
Type
==
"json_object"
)
{
if
textRequest
.
ResponseFormat
!=
nil
&&
(
textRequest
.
ResponseFormat
.
Type
==
"json_schema"
||
textRequest
.
ResponseFormat
.
Type
==
"json_object"
)
{
...
...
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