Package com.pnfsoftware.jeb.util.llm
Interface ILlmConversation
public interface ILlmConversation
A stateful conversation with a large language model endpoint.
Implementations keep the exchanged messages until clearMessages() is called, allowing
subsequent send(String) or send(List) calls to continue the same conversation.
-
Method Summary
Modifier and TypeMethodDescriptionvoidClear the accumulated message history.voidclose()Release network resources owned by this conversation.Retrieve usage information collected for this conversation.Get the accumulated provider-specific message objects for this conversation.List model names available from the configured endpoint, when supported by the provider.Send a text prompt as a user message.send(List<LlmConversationBuilder.Content> contentList) Send one or more content blocks as a user message.
-
Method Details
-
close
void close()Release network resources owned by this conversation. -
getInformation
LlmConversationBuilder.Information getInformation()Retrieve usage information collected for this conversation.- Returns:
- token and response-time counters
-
listModels
List model names available from the configured endpoint, when supported by the provider.- Returns:
- available model names
- Throws:
IOException- if the request fails or the endpoint returns an unexpected response
-
send
Send a text prompt as a user message.- Parameters:
prompt- text prompt- Returns:
- response content blocks
- Throws:
IOException- if the request fails or the endpoint returns an unsupported response
-
send
List<LlmConversationBuilder.Content> send(List<LlmConversationBuilder.Content> contentList) throws IOException Send one or more content blocks as a user message.- Parameters:
contentList- content blocks to send- Returns:
- response content blocks, such as text or tool-use requests
- Throws:
IOException- if the request fails or the endpoint returns an unsupported response
-
getMessages
Get the accumulated provider-specific message objects for this conversation.- Returns:
- an unmodifiable view of the conversation message history
-
clearMessages
void clearMessages()Clear the accumulated message history.
-