mirror of
https://github.com/kardolus/chatgpt-cli.git
synced 2024-09-08 23:15:00 +03:00
fix add missing max_token in request query
This commit is contained in:
@@ -4,13 +4,14 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
"unicode/utf8"
|
||||
|
||||
"github.com/kardolus/chatgpt-cli/config"
|
||||
"github.com/kardolus/chatgpt-cli/configmanager"
|
||||
"github.com/kardolus/chatgpt-cli/history"
|
||||
"github.com/kardolus/chatgpt-cli/http"
|
||||
"github.com/kardolus/chatgpt-cli/types"
|
||||
"strings"
|
||||
"unicode/utf8"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -163,6 +164,7 @@ func (c *Client) createBody(stream bool) ([]byte, error) {
|
||||
body := types.CompletionsRequest{
|
||||
Messages: c.History,
|
||||
Model: c.Config.Model,
|
||||
MaxTokens: c.Config.MaxTokens,
|
||||
Temperature: c.Config.Temperature,
|
||||
TopP: c.Config.TopP,
|
||||
FrequencyPenalty: c.Config.FrequencyPenalty,
|
||||
|
||||
@@ -5,6 +5,7 @@ type CompletionsRequest struct {
|
||||
Temperature float64 `json:"temperature"`
|
||||
TopP float64 `json:"top_p"`
|
||||
FrequencyPenalty float64 `json:"frequency_penalty"`
|
||||
MaxTokens int `json:"max_tokens"`
|
||||
PresencePenalty float64 `json:"presence_penalty"`
|
||||
Messages []Message `json:"messages"`
|
||||
Stream bool `json:"stream"`
|
||||
|
||||
Reference in New Issue
Block a user