feat: support ollama (close #112)

This commit is contained in:
CaIon
2024-03-12 02:36:39 +08:00
parent c3a01decd8
commit d53d3386e9
8 changed files with 117 additions and 4 deletions

View File

@@ -0,0 +1,18 @@
package ollama
import "one-api/dto"
type OllamaRequest struct {
Model string `json:"model,omitempty"`
Messages []dto.Message `json:"messages,omitempty"`
Stream bool `json:"stream,omitempty"`
Options *OllamaOptions `json:"options,omitempty"`
}
type OllamaOptions struct {
Temperature float64 `json:"temperature,omitempty"`
Seed float64 `json:"seed,omitempty"`
Topp float64 `json:"top_p,omitempty"`
TopK int `json:"top_k,omitempty"`
Stop any `json:"stop,omitempty"`
}