This commit is contained in:
2025-08-27 19:57:24 +08:00
parent 92d90b805d
commit 617b1e3849

View File

@@ -0,0 +1,26 @@
package com.agentsflex.llm.openai;
import com.agentsflex.core.llm.functions.annotation.FunctionDef;
import com.agentsflex.core.llm.functions.annotation.FunctionParam;
public class WeatherFunctions {
private static int currentIndex = 0;
private static String[] weathers = {"", "", "", ""};
@FunctionDef(name = "get_the_weather_info", description = "get the weather info")
public static String getWeatherInfo(@FunctionParam(name = "city", description = "the city name") String name) {
System.out.println(">>>>>>>>>>>>>>!!!!!!" + name);
if (currentIndex >= weathers.length) {
currentIndex = 0;
}
return weathers[currentIndex++];
}
// @FunctionDef(name = "get_city_ip", description = "get the city ip address")
// public static String getIPAddress(@FunctionParam(name = "city", description = "the city name") String name) {
// return "127.0.0.1";
// }
}