Function WEATHER_FUNCTION = Function.builder() .name("get_current_weather") .description("Get the current weather in a given location") .parameters(JsonObjectSchema.builder() .properties(new LinkedHashMap<String, JsonSchemaElement>() {{ put("location", JsonStringSchema.builder() .description("The city name") .build()); }}) .required(asList("location", "unit")) .build()) .build();// 将 Function 转换为 ToolTool WEATHER_TOOL = Tool.from(WEATHER_FUNCTION);