From 55e069c734ddb2bb4e38bf96f6a752cfbe54a73a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott9=28=E9=98=B5=E9=9B=A8=29?= <42607255+catwithtudou@users.noreply.github.com> Date: Mon, 10 Mar 2025 11:04:16 +0800 Subject: [PATCH] refactor: use consistent context variable throughout the code (#40) update: update the todoagent ctx --- quickstart/todoagent/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/quickstart/todoagent/main.go b/quickstart/todoagent/main.go index f7305a9..47018f4 100644 --- a/quickstart/todoagent/main.go +++ b/quickstart/todoagent/main.go @@ -58,7 +58,7 @@ func main() { } // 创建并配置 ChatModel - chatModel, err := openai.NewChatModel(context.Background(), &openai.ChatModelConfig{ + chatModel, err := openai.NewChatModel(ctx, &openai.ChatModelConfig{ Model: "gpt-4o", APIKey: openAIAPIKey, Temperature: gptr.Of(float32(0.7)), @@ -88,7 +88,7 @@ func main() { } // 创建 tools 节点 - todoToolsNode, err := compose.NewToolNode(context.Background(), &compose.ToolsNodeConfig{ + todoToolsNode, err := compose.NewToolNode(ctx, &compose.ToolsNodeConfig{ Tools: todoTools, }) if err != nil {