fix: add /think and /no-think added to API to run with ollama
This commit is contained in:
@ -31,13 +31,18 @@ func newOllama(endpoint, model string) *ollamaProvider {
|
||||
|
||||
func (p *ollamaProvider) Name() string { return "ollama" }
|
||||
|
||||
func (p *ollamaProvider) Summarize(ctx context.Context, prompt string) (string, error) {
|
||||
func (p *ollamaProvider) Summarize(ctx context.Context, prompt string, opts GenOptions) (string, error) {
|
||||
numCtx := 32768
|
||||
if opts.NumCtx > 0 {
|
||||
numCtx = opts.NumCtx
|
||||
}
|
||||
body := map[string]interface{}{
|
||||
"model": p.model,
|
||||
"prompt": prompt,
|
||||
"stream": false,
|
||||
"think": opts.Think,
|
||||
"options": map[string]interface{}{
|
||||
"num_ctx": 32768,
|
||||
"num_ctx": numCtx,
|
||||
},
|
||||
}
|
||||
b, _ := json.Marshal(body)
|
||||
|
||||
Reference in New Issue
Block a user