Class BaseLLMSession
java.lang.Object
com.mulesoft.modules.agent.broker.internal.extension.connection.session.BaseLLMSession
- All Implemented Interfaces:
LLMClient.LLMSession
- Direct Known Subclasses:
FunctionBasedSession,StructuredResponseSession
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final com.openai.models.responses.ResponseCreateParams.Builderprotected final com.openai.client.OpenAIClientprotected final List<com.openai.models.responses.ResponseInputItem>protected InternalReasoning -
Constructor Summary
ConstructorsConstructorDescriptionBaseLLMSession(com.openai.client.OpenAIClient client, LLMRequest llmRequest, OpenAISettings settings, List<com.openai.models.responses.Tool> tools) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddIteration(Iteration iteration) voidaddToolResponse(ToolResponse toolResponse) protected abstract CompletableFuture<org.mule.runtime.api.functional.Either<LLMOutput,ToolSelection>> final CompletableFuture<org.mule.runtime.api.functional.Either<LLMOutput,ToolSelection>> getNext()protected com.openai.models.responses.ResponseCreateParams.Builderprotected org.mule.runtime.api.functional.Either<LLMOutput,ToolSelection> onCustomCall(com.openai.models.responses.ResponseCustomToolCall toolCall) protected org.mule.runtime.api.functional.Either<LLMOutput,ToolSelection> onFunctionCall(com.openai.models.responses.ResponseFunctionToolCall toolCall) protected voidonReasoningItem(com.openai.models.responses.ResponseReasoningItem reasoningItem)
-
Field Details
-
builder
protected final com.openai.models.responses.ResponseCreateParams.Builder builder -
inputs
-
client
protected final com.openai.client.OpenAIClient client -
internalReasoning
-
-
Constructor Details
-
BaseLLMSession
public BaseLLMSession(com.openai.client.OpenAIClient client, LLMRequest llmRequest, OpenAISettings settings, List<com.openai.models.responses.Tool> tools)
-
-
Method Details
-
addIteration
- Specified by:
addIterationin interfaceLLMClient.LLMSession
-
addToolResponse
- Specified by:
addToolResponsein interfaceLLMClient.LLMSession
-
doGetNext
protected abstract CompletableFuture<org.mule.runtime.api.functional.Either<LLMOutput,ToolSelection>> doGetNext() -
getNext
public final CompletableFuture<org.mule.runtime.api.functional.Either<LLMOutput,ToolSelection>> getNext()- Specified by:
getNextin interfaceLLMClient.LLMSession
-
onCustomCall
protected org.mule.runtime.api.functional.Either<LLMOutput,ToolSelection> onCustomCall(com.openai.models.responses.ResponseCustomToolCall toolCall) -
onFunctionCall
protected org.mule.runtime.api.functional.Either<LLMOutput,ToolSelection> onFunctionCall(com.openai.models.responses.ResponseFunctionToolCall toolCall) -
onReasoningItem
protected void onReasoningItem(com.openai.models.responses.ResponseReasoningItem reasoningItem) -
getInitialRequest
- Specified by:
getInitialRequestin interfaceLLMClient.LLMSession
-
newRequestBuilder
protected com.openai.models.responses.ResponseCreateParams.Builder newRequestBuilder()
-