diff --git a/example/function_call/main.go b/example/function_call/main.go index c542a9e..dda6f36 100644 --- a/example/function_call/main.go +++ b/example/function_call/main.go @@ -77,7 +77,7 @@ NEXT_ROUND: fnName := toolCall.Function.Name if fnName == "get_current_weather" { argMap := toolCall.Function.GetArguments() - cityName := argMap["location"] + cityName := argMap["properties"]["location"] toolAnswer := getCurrentWeather(cityName) // fmt.Println("tool answer: ", tool_answer) diff --git a/qwen/func_call_dtypes.go b/qwen/func_call_dtypes.go index 36924c1..57a9ad3 100644 --- a/qwen/func_call_dtypes.go +++ b/qwen/func_call_dtypes.go @@ -42,8 +42,8 @@ type FunctionCall struct { } // API 接口返回的是 string, 这里转换为 map. -func (f FunctionCall) GetArguments() map[string]string { - argMap := make(map[string]string) +func (f FunctionCall) GetArguments() map[string]map[string]string { + argMap := make(map[string]map[string]string) err := json.Unmarshal([]byte(f.Arguments), &argMap) if err != nil { panic(err)