File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ NEXT_ROUND:
77
77
fnName := toolCall .Function .Name
78
78
if fnName == "get_current_weather" {
79
79
argMap := toolCall .Function .GetArguments ()
80
- cityName := argMap ["location" ]
80
+ cityName := argMap ["properties" ][ " location" ]
81
81
toolAnswer := getCurrentWeather (cityName )
82
82
// fmt.Println("tool answer: ", tool_answer)
83
83
Original file line number Diff line number Diff line change @@ -42,8 +42,8 @@ type FunctionCall struct {
42
42
}
43
43
44
44
// API 接口返回的是 string, 这里转换为 map.
45
- func (f FunctionCall ) GetArguments () map [string ]string {
46
- argMap := make (map [string ]string )
45
+ func (f FunctionCall ) GetArguments () map [string ]map [ string ] string {
46
+ argMap := make (map [string ]map [ string ] string )
47
47
err := json .Unmarshal ([]byte (f .Arguments ), & argMap )
48
48
if err != nil {
49
49
panic (err )
You can’t perform that action at this time.
0 commit comments