update to latest gpt model

This commit is contained in:
2025-02-01 22:57:23 -07:00
parent 91da21defb
commit b926215e94
6 changed files with 72 additions and 20 deletions

View File

@ -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)