fix: add /think and /no-think added to API to run with ollama

This commit is contained in:
2026-04-20 10:53:58 +02:00
parent 8a0edc3d59
commit 351dd3b608
6 changed files with 27 additions and 13 deletions

View File

@ -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)