From 617b1e384928baf321c825ab08cc220d01e998a5 Mon Sep 17 00:00:00 2001 From: 0007 <0007@qq.com> Date: Wed, 27 Aug 2025 19:57:24 +0800 Subject: [PATCH] Add File --- .../llm/openai/WeatherFunctions.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 agents-flex-llm/agents-flex-llm-openai/src/test/java/com/agentsflex/llm/openai/WeatherFunctions.java diff --git a/agents-flex-llm/agents-flex-llm-openai/src/test/java/com/agentsflex/llm/openai/WeatherFunctions.java b/agents-flex-llm/agents-flex-llm-openai/src/test/java/com/agentsflex/llm/openai/WeatherFunctions.java new file mode 100644 index 0000000..0078ef2 --- /dev/null +++ b/agents-flex-llm/agents-flex-llm-openai/src/test/java/com/agentsflex/llm/openai/WeatherFunctions.java @@ -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"; +// } +}