|
|
@@ -38,8 +38,8 @@ func New(ApiKey, UserId string, timeOut time.Duration) *ChatGPT {
|
|
|
client: gogpt.NewClient(ApiKey),
|
|
|
ctx: ctx,
|
|
|
userId: UserId,
|
|
|
- maxQuestionLen: 2048, // 最大问题长度
|
|
|
- maxAnswerLen: 2048, // 最大答案长度
|
|
|
+ maxQuestionLen: 2048, // 最大问题长度
|
|
|
+ maxAnswerLen: 2048, // 最大答案长度
|
|
|
maxText: 4096, // 最大文本 = 问题 + 回答, 接口限制
|
|
|
timeOut: timeOut,
|
|
|
doneChan: timeOutChan,
|
|
|
@@ -74,7 +74,7 @@ func (c *ChatGPT) Chat(question string) (answer string, err error) {
|
|
|
question = question[:c.maxText-c.maxAnswerLen]
|
|
|
}
|
|
|
req := gogpt.CompletionRequest{
|
|
|
- Model: gogpt.GPT3Dot5TurboInstruct,
|
|
|
+ Model: gogpt.GPT4oMini,
|
|
|
MaxTokens: c.maxAnswerLen,
|
|
|
Prompt: question,
|
|
|
Temperature: 0.9,
|