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
3a3f79f4
authored
Jul 27, 2024
by
CalciumIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: support ollama tools
parent
3f2df317
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
relay/channel/ollama/dto.go
+4
-3
relay/channel/ollama/relay-ollama.go
+4
-0
No files found.
relay/channel/ollama/dto.go
View file @
3a3f79f4
...
@@ -11,6 +11,10 @@ type OllamaRequest struct {
...
@@ -11,6 +11,10 @@ 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"`
Tools
[]
dto
.
ToolCall
`json:"tools,omitempty"`
ResponseFormat
*
dto
.
ResponseFormat
`json:"response_format,omitempty"`
FrequencyPenalty
float64
`json:"frequency_penalty,omitempty"`
PresencePenalty
float64
`json:"presence_penalty,omitempty"`
}
}
type
OllamaEmbeddingRequest
struct
{
type
OllamaEmbeddingRequest
struct
{
...
@@ -21,6 +25,3 @@ type OllamaEmbeddingRequest struct {
...
@@ -21,6 +25,3 @@ type OllamaEmbeddingRequest struct {
type
OllamaEmbeddingResponse
struct
{
type
OllamaEmbeddingResponse
struct
{
Embedding
[]
float64
`json:"embedding,omitempty"`
Embedding
[]
float64
`json:"embedding,omitempty"`
}
}
//type OllamaOptions struct {
//}
relay/channel/ollama/relay-ollama.go
View file @
3a3f79f4
...
@@ -36,6 +36,10 @@ func requestOpenAI2Ollama(request dto.GeneralOpenAIRequest) *OllamaRequest {
...
@@ -36,6 +36,10 @@ func requestOpenAI2Ollama(request dto.GeneralOpenAIRequest) *OllamaRequest {
Topp
:
request
.
TopP
,
Topp
:
request
.
TopP
,
TopK
:
request
.
TopK
,
TopK
:
request
.
TopK
,
Stop
:
Stop
,
Stop
:
Stop
,
Tools
:
request
.
Tools
,
ResponseFormat
:
request
.
ResponseFormat
,
FrequencyPenalty
:
request
.
FrequencyPenalty
,
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