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 Details

    • close

      void close()
      Release network resources owned by this conversation.
    • getInformation

      Retrieve usage information collected for this conversation.
      Returns:
      token and response-time counters
    • listModels

      List<String> listModels() throws IOException
      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

      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

      List<Object> 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.