add some other useful prompts
This commit is contained in:
@ -71,7 +71,7 @@ func singlePromptInteraction(systemPrompt, prompt string, retries int) (openai.C
|
||||
seconds := (1 / float64(retries)) * 60 // back off for each retry e.g. 12, 15, 20, 30, 60
|
||||
fmt.Printf("429 error, waiting %v seconds...\n", seconds)
|
||||
time.Sleep(time.Duration(seconds) * time.Second)
|
||||
return singlePromptInteraction(systemPrompt, prompt, retries-1) // TODO: establish base case to prevent forever retrying
|
||||
return singlePromptInteraction(systemPrompt, prompt, retries-1)
|
||||
}
|
||||
return openai.ChatCompletionResponse{}, fmt.Errorf("ChatCompletion request error: %w", err)
|
||||
}
|
||||
@ -125,7 +125,7 @@ func sendPrompt(messages []openai.ChatCompletionMessage, retries int) (openai.Ch
|
||||
seconds := (1 / float64(retries)) * 60 // back off for each retry e.g. 12, 15, 20, 30, 60
|
||||
fmt.Printf("429 error, waiting %v seconds...\n", seconds)
|
||||
time.Sleep(time.Duration(seconds) * time.Second)
|
||||
return sendPrompt(messages, retries-1) // TODO: establish base case to prevent forever retrying
|
||||
return sendPrompt(messages, retries-1)
|
||||
}
|
||||
return openai.ChatCompletionResponse{}, fmt.Errorf("ChatCompletion request error: %w", err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user