Package com.basis.api.admin
Class BBjAdminAIPromptRequest
java.lang.Object
com.basis.api.admin.BBjAdminAIPromptRequest
- All Implemented Interfaces:
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 Summary
ConstructorsConstructorDescriptionBBjAdminAIPromptRequest(String userPrompt) Constructs a prompt request with the given user message. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddHistory(BBjAdminAIChatMessage message) Appends a single prior conversation turn to the history.Returns an unmodifiable view of the prior conversation turns that will be sent to the LLM as context.intMaximum tokens to generate.Returns the optional system-level instruction override.doubleSampling temperature override (0.0–1.0).The user's question / instruction for this request.voidsetConversationHistory(List<BBjAdminAIChatMessage> messages) Replaces the entire conversation history.voidsetMaxTokens(int maxTokens) voidsetSystemPrompt(String systemPrompt) Overrides the system prompt for this request only.voidsetTemperature(double temperature)
-
Constructor Details
-
BBjAdminAIPromptRequest
Constructs a prompt request with the given user message.- Parameters:
userPrompt- The user's question or instruction. Must not be blank.
-
-
Method Details
-
getUserPrompt
The user's question / instruction for this request. -
getSystemPrompt
Returns the optional system-level instruction override.nullmeans the provider's configured default system prompt is used. -
setSystemPrompt
Overrides the system prompt for this request only. Passnullto revert to the provider's configured default. -
getConversationHistory
Returns an unmodifiable view of the prior conversation turns that will be sent to the LLM as context. -
addHistory
Appends a single prior conversation turn to the history.- Parameters:
message- A message created viaBBjAdminAIChatMessage.user(java.lang.String),BBjAdminAIChatMessage.assistant(java.lang.String), orBBjAdminAIChatMessage.system(java.lang.String).
-
setConversationHistory
Replaces the entire conversation history.- Parameters:
messages- List of prior turns, ornull/ 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. Use0(the default) to inherit the provider's configured maximum. -
setMaxTokens
public void setMaxTokens(int maxTokens)
-