Class Message
java.lang.Object
co.elastic.clients.elasticsearch.inference.Message
- All Implemented Interfaces:
- JsonpSerializable
An object representing part of the conversation.
- See Also:
- 
Nested Class SummaryNested Classes
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final JsonpDeserializer<Message>Json deserializer forMessage
- 
Method SummaryModifier and TypeMethodDescriptionfinal MessageContentcontent()The content of the message.static Messagefinal Stringrole()Required - The role of the message author.voidserialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) Serialize this object to JSON.protected voidserializeInternal(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) protected static voidfinal StringOnly fortoolrole messages.Only forassistantrole messages.toString()
- 
Field Details- 
_DESERIALIZERJson deserializer forMessage
 
- 
- 
Method Details- 
of
- 
contentThe content of the message.String example: { "content": "Some string" }Object example: { "content": [ { "text": "Some text", "type": "text" } ] }API name: content
- 
roleRequired - The role of the message author. Valid values areuser,assistant,system, andtool.API name: role
- 
toolCallIdOnly fortoolrole messages. The tool call that this message is responding to.API name: tool_call_id
- 
toolCallsOnly forassistantrole messages. The tool calls generated by the model. If it's specified, thecontentfield is optional. Example:{ "tool_calls": [ { "id": "call_KcAjWtAww20AihPHphUh46Gd", "type": "function", "function": { "name": "get_current_weather", "arguments": "{\"location\":\"Boston, MA\"}" } } ] }API name: tool_calls
- 
serializeSerialize this object to JSON.- Specified by:
- serializein interface- JsonpSerializable
 
- 
serializeInternal
- 
toString
- 
setupMessageDeserializer
 
-