refactor(app):优化工具调用

- 在 SearchStockByIndicators 和 GetStockKLine 函数的描述中移除了关于并行调用限制的说明
- 优化了函数描述,使其更加简洁和通用
This commit is contained in:
ArvinLovegood 2025-07-03 14:49:16 +08:00
parent 5e7f34652a
commit 44e1093e8e
2 changed files with 3 additions and 3 deletions

4
app.go
View File

@ -60,7 +60,7 @@ func AddTools(tools []data.Tool) []data.Tool {
Type: "function",
Function: data.ToolFunction{
Name: "SearchStockByIndicators",
Description: "根据自然语言筛选股票,返回自然语言选股条件要求的股票所有相关数据。输入股票名称可以获取当前股票最新的股价交易数据和基础财务指标信息,多个股票名称使用,分隔。工具限制:不允许并行调用",
Description: "根据自然语言筛选股票,返回自然语言选股条件要求的股票所有相关数据。输入股票名称可以获取当前股票最新的股价交易数据和基础财务指标信息,多个股票名称使用,分隔。",
Parameters: data.FunctionParameters{
Type: "object",
Properties: map[string]any{
@ -86,7 +86,7 @@ func AddTools(tools []data.Tool) []data.Tool {
Type: "function",
Function: data.ToolFunction{
Name: "GetStockKLine",
Description: "获取股票日K线数据。工具限制:不允许并行调用",
Description: "获取股票日K线数据。",
Parameters: data.FunctionParameters{
Type: "object",
Properties: map[string]any{

View File

@ -1018,8 +1018,8 @@ func AskAiWithTools(o OpenAi, err error, messages []map[string]interface{}, ch c
})
}
AskAiWithTools(o, err, messages, ch, question, tools)
}
AskAiWithTools(o, err, messages, ch, question, tools)
}
if choice.FinishReason == "stop" {