update to latest gpt model
This commit is contained in:
@ -17,6 +17,7 @@ func main() {
|
||||
fmt.Println("---------------------")
|
||||
|
||||
systemPrompt := ""
|
||||
//systemPrompt := "You are Mixtral, a locally hosted AI assistant."
|
||||
|
||||
messages := []openai.ChatCompletionMessage{
|
||||
{
|
||||
@ -52,13 +53,12 @@ func main() {
|
||||
}
|
||||
|
||||
fmt.Println("AI: ", resp.Choices[0].Message.Content)
|
||||
//fmt.Println("Finish Reason: ", resp.Choices[0].FinishReason)
|
||||
messages = append(messages, resp.Choices[0].Message)
|
||||
|
||||
currLength := estimateTokenCount(messages)
|
||||
|
||||
if currLength > 3000 {
|
||||
fmt.Println("Token count exceeded 3000, summarizing context")
|
||||
if currLength > 2000 {
|
||||
fmt.Println("Token count exceeded 2000, summarizing context")
|
||||
summarized, err := summarizeChatSoFar(messages)
|
||||
if err != nil {
|
||||
fmt.Printf("error summarizing chat so far | %v\n", err)
|
||||
|
Reference in New Issue
Block a user