Compare commits
No commits in common. "2f3d95356aa0ca07f28c808399e65905818cc902" and "c02b21ca3705dc7cb5d785a5eb88eefd3b268355" have entirely different histories.
2f3d95356a
...
c02b21ca37
@ -64,11 +64,12 @@ func LLMRequest(messages []Message) (string, error) {
|
|||||||
go HandleDelayedContent(receiver)
|
go HandleDelayedContent(receiver)
|
||||||
|
|
||||||
response, err := CreateChatCompletionStream(model, messages, maxTokens, receiver)
|
response, err := CreateChatCompletionStream(model, messages, maxTokens, receiver)
|
||||||
if response != "" {
|
if err != nil && response != "" {
|
||||||
if err != nil {
|
|
||||||
Warn("Received partial response. Error: %v\n", err)
|
Warn("Received partial response. Error: %v\n", err)
|
||||||
err = nil
|
err = nil // ignore partial response error
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if response != "" {
|
||||||
// there was some content, so break to a new line after it
|
// there was some content, so break to a new line after it
|
||||||
fmt.Println()
|
fmt.Println()
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,6 @@ func CreateChatCompletionRequest(model string, messages []Message, maxTokens int
|
|||||||
Model: model,
|
Model: model,
|
||||||
Messages: chatCompletionMessages,
|
Messages: chatCompletionMessages,
|
||||||
MaxTokens: maxTokens,
|
MaxTokens: maxTokens,
|
||||||
N: 1, // limit responses to 1 "choice". we use choices[0] to reference it
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user