Is your feature request related to a problem? Please describe.*
It would be neat if we made it possible for Automatic Function Calling (AFC) to also work with non-static instance methods, so that (something like) this would work, note how getCurrentWeather is not static here:
public class GenerateContentWithFunctionCall {
public String getCurrentWeather(String location, String unit) {
return "The weather in " + location + " is " + "very nice.";
}
public static void main(String[] args) throws NoSuchMethodException {
GenerateContentWithFunctionCall instance = new GenerateContentWithFunctionCall();
Method method =
GenerateContentWithFunctionCall.class.getMethod(
"getCurrentWeather", String.class, String.class);
GenerateContentConfig config =
GenerateContentConfig.builder()
.tools(Tool.builder().functions(method, instance))
.build();
Is your feature request related to a problem? Please describe.*
It would be neat if we made it possible for Automatic Function Calling (AFC) to also work with non-static instance methods, so that (something like) this would work, note how
getCurrentWeatheris notstatichere: