spring-ai icon indicating copy to clipboard operation
spring-ai copied to clipboard

Support for declarative build function callbacks in the Spring container

Open KAMO030 opened this issue 1 year ago • 0 comments

  • add FunctionCallbackMethodProcessor to support parsing.
  • add the FunctionCalling annotation to declare
  • add FunctionCallbackMethodProcessorIT as test

Dependent on https://github.com/spring-projects/spring-ai/pull/1099

define:

public  class FunctionCallConfig {
		@FunctionCalling(name = "dateTime", description = "get the current date and time")
		public String dateTime(String location) {
			return location + " dateTime:" + LocalDateTime.now();
		}
}

use:

client.prompt().user("What is the time in New York?").functions("dateTime").call().content();

KAMO030 avatar Jul 24 '24 04:07 KAMO030