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
8f3c7280
authored
Feb 24, 2025
by
1808837298@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: Support max_tokens parameter for Ollama channel #782
parent
e5e73a33
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
0 deletions
+2
-0
relay/channel/ollama/dto.go
+1
-0
relay/channel/ollama/relay-ollama.go
+1
-0
No files found.
relay/channel/ollama/dto.go
View file @
8f3c7280
...
@@ -11,6 +11,7 @@ type OllamaRequest struct {
...
@@ -11,6 +11,7 @@ type OllamaRequest 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"`
Stop
any
`json:"stop,omitempty"`
Stop
any
`json:"stop,omitempty"`
MaxTokens
uint
`json:"max_tokens,omitempty"`
Tools
[]
dto
.
ToolCall
`json:"tools,omitempty"`
Tools
[]
dto
.
ToolCall
`json:"tools,omitempty"`
ResponseFormat
any
`json:"response_format,omitempty"`
ResponseFormat
any
`json:"response_format,omitempty"`
FrequencyPenalty
float64
`json:"frequency_penalty,omitempty"`
FrequencyPenalty
float64
`json:"frequency_penalty,omitempty"`
...
...
relay/channel/ollama/relay-ollama.go
View file @
8f3c7280
...
@@ -58,6 +58,7 @@ func requestOpenAI2Ollama(request dto.GeneralOpenAIRequest) (*OllamaRequest, err
...
@@ -58,6 +58,7 @@ func requestOpenAI2Ollama(request dto.GeneralOpenAIRequest) (*OllamaRequest, err
TopK
:
request
.
TopK
,
TopK
:
request
.
TopK
,
Stop
:
Stop
,
Stop
:
Stop
,
Tools
:
request
.
Tools
,
Tools
:
request
.
Tools
,
MaxTokens
:
request
.
MaxTokens
,
ResponseFormat
:
request
.
ResponseFormat
,
ResponseFormat
:
request
.
ResponseFormat
,
FrequencyPenalty
:
request
.
FrequencyPenalty
,
FrequencyPenalty
:
request
.
FrequencyPenalty
,
PresencePenalty
:
request
.
PresencePenalty
,
PresencePenalty
:
request
.
PresencePenalty
,
...
...
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