feat(ai): test saved summary model generation (#43)
This commit is contained in:
@ -64,6 +64,9 @@ func (p *OllamaProvider) Summarize(ctx context.Context, prompt string, opts GenO
|
||||
"num_ctx": numCtx,
|
||||
},
|
||||
}
|
||||
if opts.MaxOutputTokens > 0 {
|
||||
body["options"].(map[string]interface{})["num_predict"] = opts.MaxOutputTokens
|
||||
}
|
||||
if opts.JSONMode {
|
||||
body["format"] = "json"
|
||||
}
|
||||
@ -80,9 +83,9 @@ func (p *OllamaProvider) Summarize(ctx context.Context, prompt string, opts GenO
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
raw, _ := io.ReadAll(resp.Body)
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
return "", &summaryHTTPError{status: resp.StatusCode, err: fmt.Errorf("ollama API error %d: %s", resp.StatusCode, raw)}
|
||||
raw, err := readGenerationResponse(resp)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
var result struct {
|
||||
|
||||
Reference in New Issue
Block a user