Interface PromptResponse

All Superinterfaces:
MetaCarrier

public interface PromptResponse extends MetaCarrier
Represents the result of a prompts/get call.

The result contains a list of messages which should be used to prompt the LLM.

Returning a PromptResponse from a Prompt-annotated method gives more control over the response that's returned to the client.

  • Method Details

    • description

      Optional<String> description()
      A description of the prompt
      Returns:
      the description, or an empty Optional if not provided
    • messages

      List<PromptMessage> messages()
      The prompt messages
      Returns:
      the messages
    • builder

      static PromptResponse.Builder builder()
      Create a builder for a new PromptResponse
      Returns:
      the new PromptResponse builder
    • of

      static PromptResponse of(Role role, ContentBlock content)
      Create a new PromptResponse with a single message
      Parameters:
      role - the role for the message
      content - the content of the message
      Returns:
      the new prompt response