Skip to content

Commit

Permalink
fix: optimal prompt (#6184)
Browse files Browse the repository at this point in the history
  • Loading branch information
wangzhuzhen authored Dec 21, 2023
1 parent 3fcbe9a commit 142504b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion internal/pkg/ai-functions/functions/test-case/function.go
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ func processSingleTestCase(ctx context.Context, factory functions.FunctionFactor
return errors.Wrap(err, "processSingleTestCase get requirement related tasks info failed")
}
for _, include := range issueRelations.IssueInclude {
if include.Type == apistructs.IssueTypeTask {
if include.Type == apistructs.IssueTypeTask && (include.TaskType == "dev" || include.TaskType == "开发") {
tasks = append(tasks, include.Title)
}
}
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/ai-functions/functions/test-case/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func generateGroupsFromRequirement(ctx context.Context, wg *sync.WaitGroup, user
return errors.Wrap(err, "generateGroupsFromRequirement get requirement related tasks info failed")
}
for _, include := range issueRelations.IssueInclude {
if include.Type == apistructs.IssueTypeTask {
if include.Type == apistructs.IssueTypeTask && (include.TaskType == "dev" || include.TaskType == "开发") {
tasks = append(tasks, include.Title)
}
}
Expand Down
4 changes: 1 addition & 3 deletions internal/pkg/ai-functions/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ import (
"os"
"reflect"

"github.com/pkg/errors"

"github.com/erda-project/erda-infra/base/logs"
"github.com/erda-project/erda-infra/base/servicehub"
"github.com/erda-project/erda-infra/pkg/transport"
Expand Down Expand Up @@ -72,7 +70,7 @@ func (p *provider) Init(ctx servicehub.Context) (err error) {
p.Config.ModelIds["gpt-4"] = os.Getenv(handler.EnvAiProxyChatgpt4ModelId)
}
if p.Config.ModelIds["gpt-4"] == "" {
return errors.Errorf("env %s not set", handler.EnvAiProxyChatgpt4ModelId)
p.L.Warnf("env %s not set", handler.EnvAiProxyChatgpt4ModelId)
}

pb.RegisterAiFunctionImp(p.R, p.AIFunction())
Expand Down

0 comments on commit 142504b

Please sign in to comment.