chore(release): 版本发布 - publish v1.5.1
This commit is contained in:
1 parent
4eaa28b807
commit
9eb2fcd453
35 files changed
+1127
-304
No files matched your search
@@ -9,21 +9,21 @@ import (
|
||||
)
|
||||
|
||||
func cloudAgentOutputViolation(text string, callCount int) string {
|
||||
if len(text) > 32000 {
|
||||
return fmt.Sprintf("正文 %d 字符,超过单步 32000 字符上限", len(text))
|
||||
if len(text) > cloudAgentMaxOutputBytes {
|
||||
return fmt.Sprintf("正文 %d 字节,超过单步 %d 字节上限", len(text), cloudAgentMaxOutputBytes)
|
||||
}
|
||||
if callCount > 8 {
|
||||
return fmt.Sprintf("一次发起了 %d 个工具调用,超过单步 8 个上限", callCount)
|
||||
if callCount > cloudAgentMaxToolCalls {
|
||||
return fmt.Sprintf("一次发起了 %d 个工具调用,超过单步 %d 个上限", callCount, cloudAgentMaxToolCalls)
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (s *Service) correctCloudAgentOutput(run *model.CloudAgentExecution, state *cloudAgentRuntime, violation string) error {
|
||||
return s.repo.MutateCloudAgent(run.UserID, run.ID, run.Revision, func(current *model.CloudAgentExecution, _ *repository.Repository) error {
|
||||
state.Canonical.Messages = append(state.Canonical.Messages, map[string]any{
|
||||
"role": "user",
|
||||
"content": fmt.Sprintf("你上一条回复不合规:%s。请**重新输出一次**:正文精简到 32000 字符内,工具调用不超过 8 个;需要更多调用就分成多次,每次只调必要的几个。不要复述这条提示。", violation),
|
||||
})
|
||||
state.Canonical.Messages = append(state.Canonical.Messages, cloudAgentRuntimeMessage(cloudAgentRuntimeContext{
|
||||
Kind: cloudAgentContextInvalidOutput, Detail: violation,
|
||||
MaxOutputBytes: cloudAgentMaxOutputBytes, MaxToolCalls: cloudAgentMaxToolCalls,
|
||||
}))
|
||||
state.ActiveTaskID = ""
|
||||
state.Calls = nil
|
||||
state.CallIndex = 0
|
||||
@@ -40,10 +40,7 @@ func cloudAgentTruncatedToolArguments(task *model.Task) bool {
|
||||
|
||||
func (s *Service) correctCloudAgentTruncatedCalls(run *model.CloudAgentExecution, state *cloudAgentRuntime) error {
|
||||
return s.repo.MutateCloudAgent(run.UserID, run.ID, run.Revision, func(current *model.CloudAgentExecution, _ *repository.Repository) error {
|
||||
state.Canonical.Messages = append(state.Canonical.Messages, map[string]any{
|
||||
"role": "user",
|
||||
"content": "你上一条工具调用的参数 JSON 被输出长度上限截断了(一次写不完)。请**拆成多次调用**重新提交:每次 canvas_apply_ops 只写少量内容(例如分镜表每次不超过 3 行),多次调用累积完成,不要试图一次写完。不要复述这条提示。",
|
||||
})
|
||||
state.Canonical.Messages = append(state.Canonical.Messages, cloudAgentRuntimeMessage(cloudAgentRuntimeContext{Kind: cloudAgentContextTruncatedArguments}))
|
||||
state.ActiveTaskID = ""
|
||||
state.Calls = nil
|
||||
state.CallIndex = 0
|
||||
|
||||
Reference in new issue
Block a user