Uses of Class
com.google.genkit.ai.Message
Packages that use Message
Package
Description
Provides session management for multi-turn agent conversations with
persistence.
-
Uses of Message in com.google.genkit.ai
Methods in com.google.genkit.ai that return MessageModifier and TypeMethodDescriptionAdds a part to the message content.Message.Builder.build()Candidate.getMessage()ModelResponse.getMessage()Returns the first candidate's message.static MessageCreates a model message with text content.static MessageCreates a system message with text content.static MessageCreates a tool message with content.static MessageCreates a user message with text content.Methods in com.google.genkit.ai that return types with arguments of type MessageModifier and TypeMethodDescriptionGenerateAction.GenerateActionOptions.getMessages()GenerateOptions.getMessages()Gets the conversation messages.ModelRequest.getMessages()ModelResponse.getMessages()Returns all messages including the model's response.Methods in com.google.genkit.ai with parameters of type MessageModifier and TypeMethodDescriptionModelRequest.addMessage(Message message) Adds a message to the request.ModelRequest.Builder.addMessage(Message message) voidCandidate.setMessage(Message message) Method parameters in com.google.genkit.ai with type arguments of type MessageModifier and TypeMethodDescriptionvoidGenerateAction.GenerateActionOptions.setMessages(List<Message> messages) voidModelRequest.setMessages(List<Message> messages) Constructors in com.google.genkit.ai with parameters of type MessageModifierConstructorDescriptionCreates a Candidate with a message.Candidate(Message message, FinishReason finishReason) Creates a Candidate with message and finish reason.Constructor parameters in com.google.genkit.ai with type arguments of type MessageModifierConstructorDescriptionGenerateOptions(String model, String prompt, List<Message> messages, List<Document> docs, String system, List<Tool<?, ?>> tools, Object toolChoice, OutputConfig output, GenerationConfig config, Map<String, Object> context, Integer maxTurns, ResumeOptions resume, Class<T> outputClass) Creates new GenerateOptions.ModelRequest(List<Message> messages) Creates a ModelRequest with the given messages. -
Uses of Message in com.google.genkit.ai.session
Methods in com.google.genkit.ai.session that return types with arguments of type MessageModifier and TypeMethodDescriptionChat.getHistory()Gets the current conversation history.Session.getMessages()Gets the message history for the default thread.Session.getMessages(String threadName) Gets the message history for a thread.SessionData.getOrCreateThread(String threadName) Gets or creates a thread by name.Gets a specific thread by name.SessionData.getThreads()Gets all conversation threads.Methods in com.google.genkit.ai.session with parameters of type MessageModifier and TypeMethodDescriptionSends a message and gets a response.Chat.send(Message message, Chat.SendOptions sendOptions) Sends a message with send options and gets a response.Chat.sendStream(Message message, Chat.SendOptions sendOptions, Consumer<ModelResponseChunk> streamCallback) Sends a message with streaming response.Method parameters in com.google.genkit.ai.session with type arguments of type MessageModifier and TypeMethodDescriptionvoidSets messages for a specific thread.voidSessionData.setThreads(Map<String, List<Message>> threads) Sets all conversation threads.Adds a thread.Sets the conversation threads.Session.updateMessages(String threadName, List<Message> messages) Updates the messages for a thread and persists them.