feat: add weather tracing and unify example system prompts
Move shared prompt constants into pkg/opt and use them across examples. Add agent, model, and tool tracing to the weather example, with tests, and update weather argument descriptions and parse-error logging. Strip timestamp and speaker markers from final ADK voice transcripts, keeping normal bracketed text and treating marker-only results as empty. Co-authored-by: TRAE CLI <traecli@bytedance.com>
This commit is contained in:
1 parent
ee8afb10db
commit
1512f0516f
15 files changed
+332
-17
No files matched your search
@@ -8,6 +8,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"example.com/ueino/pkg/opt"
|
||||
"github.com/cloudwego/eino/components/model"
|
||||
"github.com/cloudwego/eino/compose"
|
||||
"github.com/cloudwego/eino/schema"
|
||||
@@ -46,9 +47,10 @@ func NewChain(ctx context.Context, chat model.BaseChatModel) (compose.Runnable[[
|
||||
|
||||
func beforeChat(ctx context.Context, messages []*schema.Message, _ *struct{}) ([]*schema.Message, error) {
|
||||
now := time.Now().In(time.FixedZone("Asia/Shanghai", 8*60*60))
|
||||
sp := fmt.Sprintf(`你是一个简洁的中文助手。
|
||||
sp := fmt.Sprintf(`%s
|
||||
---
|
||||
"当前时区:Asia/Shanghai(UTC+08:00)\n当前时间:%s`, now.Format("2006-01-02 15:04:05"))
|
||||
"当前时区:Asia/Shanghai(UTC+08:00)
|
||||
当前时间:%s`, opt.SYSTEM_PROMPT, now.Format("2006-01-02 15:04:05"))
|
||||
return append([]*schema.Message{schema.SystemMessage(sp)}, messages...), nil
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user