feat: add retry to chat completion client
This commit is contained in:
@ -16,6 +16,7 @@ import (
|
||||
"forge.cadoles.com/wpetit/clearcase/internal/core/model"
|
||||
"forge.cadoles.com/wpetit/clearcase/internal/core/port"
|
||||
"github.com/bornholm/genai/llm"
|
||||
"github.com/bornholm/genai/llm/prompt"
|
||||
"github.com/num30/go-cache"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
@ -219,7 +220,7 @@ func (m *ForgeManager) getPullRequestSystemPrompt(ctx context.Context, user *mod
|
||||
prTemplate = pullRequestDefaultTemplate
|
||||
}
|
||||
|
||||
systemPrompt, err := llm.PromptTemplate(pullRequestSystemPromptRawTemplate, struct {
|
||||
systemPrompt, err := prompt.Template(pullRequestSystemPromptRawTemplate, struct {
|
||||
PullRequestTemplate string
|
||||
}{
|
||||
PullRequestTemplate: prTemplate,
|
||||
@ -257,7 +258,7 @@ func (m *ForgeManager) getPullRequestUserPrompt(ctx context.Context, user *model
|
||||
return "", errors.WithStack(err)
|
||||
}
|
||||
|
||||
userPrompt, err := llm.PromptTemplate(pullRequestUserPromptRawTemplate, struct {
|
||||
userPrompt, err := prompt.Template(pullRequestUserPromptRawTemplate, struct {
|
||||
Summary string
|
||||
Project *model.Project
|
||||
ProjectLanguages []string
|
||||
@ -350,7 +351,7 @@ func (m *ForgeManager) getIssueSystemPrompt(ctx context.Context, user *model.Use
|
||||
issueTemplate = issueDefaultTemplate
|
||||
}
|
||||
|
||||
systemPrompt, err := llm.PromptTemplate(issueSystemPromptRawTemplate, struct {
|
||||
systemPrompt, err := prompt.Template(issueSystemPromptRawTemplate, struct {
|
||||
IssueTemplate string
|
||||
}{
|
||||
IssueTemplate: issueTemplate,
|
||||
@ -383,7 +384,7 @@ func (m *ForgeManager) getIssueUserPrompt(ctx context.Context, user *model.User,
|
||||
return "", errors.WithStack(err)
|
||||
}
|
||||
|
||||
userPrompt, err := llm.PromptTemplate(issueUserPromptRawTemplate, struct {
|
||||
userPrompt, err := prompt.Template(issueUserPromptRawTemplate, struct {
|
||||
Summary string
|
||||
Project *model.Project
|
||||
ProjectLanguages []string
|
||||
|
Reference in New Issue
Block a user