Class BBjAdminAIPromptRequest

java.lang.Object
com.basis.api.admin.BBjAdminAIPromptRequest
All Implemented Interfaces:
Serializable

public class BBjAdminAIPromptRequest extends Object implements Serializable
Encapsulates a request to the LLM for use with BBjAdminAI.sendPrompt(BBjAdminAIPromptRequest).

Provides full control over the system prompt, conversation history, sampling temperature, and token limit. For simple one-shot prompts use BBjAdminAI.sendPrompt(String) instead.

 BBjAdminAIPromptRequest req = new BBjAdminAIPromptRequest("Explain correlated subqueries.");
 req.setSystemPrompt("You are a concise SQL explainer.");
 req.setTemperature(0.5);
 BBjAdminAIPromptResponse resp = ai.sendPrompt(req);
 

Multi-turn example:

 BBjAdminAIPromptRequest req = new BBjAdminAIPromptRequest("Which of those tables stores addresses?");
 req.addHistory(BBjAdminAIChatMessage.user("What tables are in the database?"));
 req.addHistory(BBjAdminAIChatMessage.assistant("CUSTOMER, INVOICE, ADDRESS"));
 BBjAdminAIPromptResponse resp = ai.sendPrompt(req);
 
See Also:
  • Constructor Details

    • BBjAdminAIPromptRequest

      public BBjAdminAIPromptRequest(String userPrompt)
      Constructs a prompt request with the given user message.
      Parameters:
      userPrompt - The user's question or instruction. Must not be blank.
  • Method Details

    • getUserPrompt

      public String getUserPrompt()
      The user's question / instruction for this request.
    • getSystemPrompt

      public String getSystemPrompt()
      Returns the optional system-level instruction override. null means the provider's configured default system prompt is used.
    • setSystemPrompt

      public void setSystemPrompt(String systemPrompt)
      Overrides the system prompt for this request only. Pass null to revert to the provider's configured default.
    • getConversationHistory

      public List<BBjAdminAIChatMessage> getConversationHistory()
      Returns an unmodifiable view of the prior conversation turns that will be sent to the LLM as context.
    • addHistory

      public void addHistory(BBjAdminAIChatMessage message)
      Appends a single prior conversation turn to the history.
      Parameters:
      message - A message created via BBjAdminAIChatMessage.user(java.lang.String), BBjAdminAIChatMessage.assistant(java.lang.String), or BBjAdminAIChatMessage.system(java.lang.String).
    • setConversationHistory

      public void setConversationHistory(List<BBjAdminAIChatMessage> messages)
      Replaces the entire conversation history.
      Parameters:
      messages - List of prior turns, or null / empty to clear.
    • getTemperature

      public double getTemperature()
      Sampling temperature override (0.0–1.0). Use -1 (the default) to inherit the provider's configured temperature.
    • setTemperature

      public void setTemperature(double temperature)
    • getMaxTokens

      public int getMaxTokens()
      Maximum tokens to generate. Use 0 (the default) to inherit the provider's configured maximum.
    • setMaxTokens

      public void setMaxTokens(int maxTokens)