Package com.google.genkit.plugins.spring
Class GenkitSpringApplication
java.lang.Object
com.google.genkit.plugins.spring.GenkitSpringApplication
Spring Boot application class for Genkit.
This class is the entry point for Spring Boot auto-configuration and component scanning for the Genkit Spring plugin.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongenkitAgentController(com.fasterxml.jackson.databind.ObjectMapper objectMapper) Creates the Genkit agent controller bean.genkitFlowController(com.fasterxml.jackson.databind.ObjectMapper objectMapper) Creates the Genkit flow controller bean.org.springframework.web.servlet.config.annotation.WebMvcConfigurergenkitJackson2MessageConverterConfigurer(com.fasterxml.jackson.databind.ObjectMapper objectMapper) Configures Spring MVC to deserialize@RequestBodyJSON using the Jackson 2 (com.fasterxml.jackson.databind)ObjectMapperthatGenkitFlowControllerandGenkitAgentControlleruse forJsonNodehandling.com.fasterxml.jackson.databind.ObjectMapperCreates an ObjectMapper bean for JSON serialization.
-
Constructor Details
-
GenkitSpringApplication
public GenkitSpringApplication()
-
-
Method Details
-
objectMapper
@Bean public com.fasterxml.jackson.databind.ObjectMapper objectMapper()Creates an ObjectMapper bean for JSON serialization.- Returns:
- the ObjectMapper
-
genkitFlowController
@Bean public GenkitFlowController genkitFlowController(com.fasterxml.jackson.databind.ObjectMapper objectMapper) Creates the Genkit flow controller bean.- Parameters:
objectMapper- the ObjectMapper for JSON serialization- Returns:
- the flow controller
-
genkitAgentController
@Bean public GenkitAgentController genkitAgentController(com.fasterxml.jackson.databind.ObjectMapper objectMapper) Creates the Genkit agent controller bean.- Parameters:
objectMapper- the ObjectMapper for JSON serialization- Returns:
- the agent controller
-
genkitJackson2MessageConverterConfigurer
@Bean public org.springframework.web.servlet.config.annotation.WebMvcConfigurer genkitJackson2MessageConverterConfigurer(com.fasterxml.jackson.databind.ObjectMapper objectMapper) Configures Spring MVC to deserialize@RequestBodyJSON using the Jackson 2 (com.fasterxml.jackson.databind)ObjectMapperthatGenkitFlowControllerandGenkitAgentControlleruse forJsonNodehandling.spring-boot-starter-webon Spring Boot 4 auto-configures a Jackson 3 (tools.jackson.databind) message converter as the default JSON converter. Jackson 3's binder cannot construct instances of the Jackson 2com.fasterxml.jackson.databind.JsonNodetype used throughout Genkit's core action APIs, so@RequestBody JsonNodeparameters would otherwise fail to bind. Prepending aMappingJackson2HttpMessageConverterbacked by the Jackson 2ObjectMappermakes it the preferred converter forapplication/jsonbodies.- Parameters:
objectMapper- the Jackson 2 ObjectMapper for JSON serialization- Returns:
- the MVC configurer
-