Package io.camunda.client.impl.command
Class UpdateAgentInstanceCommandImpl
java.lang.Object
io.camunda.client.impl.command.UpdateAgentInstanceCommandImpl
- All Implemented Interfaces:
FinalCommandStep<UpdateAgentInstanceResponse>,UpdateAgentInstanceCommandStep1,UpdateAgentInstanceCommandStep1.UpdateAgentInstanceCommandStep2
public class UpdateAgentInstanceCommandImpl
extends Object
implements UpdateAgentInstanceCommandStep1, UpdateAgentInstanceCommandStep1.UpdateAgentInstanceCommandStep2
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.camunda.client.api.command.UpdateAgentInstanceCommandStep1
UpdateAgentInstanceCommandStep1.AgentTool, UpdateAgentInstanceCommandStep1.UpdateAgentInstanceCommandStep2 -
Constructor Summary
ConstructorsConstructorDescriptionUpdateAgentInstanceCommandImpl(long agentInstanceKey, HttpClient httpClient, JsonMapper jsonMapper) -
Method Summary
Modifier and TypeMethodDescriptionelementInstanceKey(long elementInstanceKey) Sets the currently-active element instance for this agent instance.inputTokens(long inputTokens) Increments the input token counter by the given delta.modelCalls(int modelCalls) Increments the model call counter by the given delta.outputTokens(long outputTokens) Increments the output token counter by the given delta.requestTimeout(Duration requestTimeout) Sets the request timeout for the command.send()Sends the command to the Camunda gateway.status(AgentInstanceUpdateStatus status) Sets the new status of the agent instance.toolCalls(int toolCalls) Increments the tool call counter by the given delta.Replaces the full list of tools available to the agent instance.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.camunda.client.api.command.FinalCommandStep
execute
-
Constructor Details
-
UpdateAgentInstanceCommandImpl
public UpdateAgentInstanceCommandImpl(long agentInstanceKey, HttpClient httpClient, JsonMapper jsonMapper)
-
-
Method Details
-
elementInstanceKey
public UpdateAgentInstanceCommandStep1.UpdateAgentInstanceCommandStep2 elementInstanceKey(long elementInstanceKey) Description copied from interface:UpdateAgentInstanceCommandStep1Sets the currently-active element instance for this agent instance. The engine uses this both for ownership/equality validation and — when the supplied key differs from the previous association (re-entry of an ad-hoc sub-process or AI Agent task) — to append the key to the accumulated list of associated element instances.- Specified by:
elementInstanceKeyin interfaceUpdateAgentInstanceCommandStep1- Parameters:
elementInstanceKey- the key of the element instance. Must be greater than 0.- Returns:
- the next step of the builder
-
status
public UpdateAgentInstanceCommandStep1.UpdateAgentInstanceCommandStep2 status(AgentInstanceUpdateStatus status) Description copied from interface:UpdateAgentInstanceCommandStep1.UpdateAgentInstanceCommandStep2Sets the new status of the agent instance.- Specified by:
statusin interfaceUpdateAgentInstanceCommandStep1.UpdateAgentInstanceCommandStep2- Parameters:
status- the new status; seeAgentInstanceUpdateStatusfor available values- Returns:
- this builder for method chaining
-
inputTokens
public UpdateAgentInstanceCommandStep1.UpdateAgentInstanceCommandStep2 inputTokens(long inputTokens) Description copied from interface:UpdateAgentInstanceCommandStep1.UpdateAgentInstanceCommandStep2Increments the input token counter by the given delta.- Specified by:
inputTokensin interfaceUpdateAgentInstanceCommandStep1.UpdateAgentInstanceCommandStep2- Parameters:
inputTokens- the number of input tokens to add. Must be >= 0.- Returns:
- this builder for method chaining
-
outputTokens
public UpdateAgentInstanceCommandStep1.UpdateAgentInstanceCommandStep2 outputTokens(long outputTokens) Description copied from interface:UpdateAgentInstanceCommandStep1.UpdateAgentInstanceCommandStep2Increments the output token counter by the given delta.- Specified by:
outputTokensin interfaceUpdateAgentInstanceCommandStep1.UpdateAgentInstanceCommandStep2- Parameters:
outputTokens- the number of output tokens to add. Must be >= 0.- Returns:
- this builder for method chaining
-
modelCalls
Description copied from interface:UpdateAgentInstanceCommandStep1.UpdateAgentInstanceCommandStep2Increments the model call counter by the given delta.- Specified by:
modelCallsin interfaceUpdateAgentInstanceCommandStep1.UpdateAgentInstanceCommandStep2- Parameters:
modelCalls- the number of model calls to add. Must be >= 0.- Returns:
- this builder for method chaining
-
toolCalls
Description copied from interface:UpdateAgentInstanceCommandStep1.UpdateAgentInstanceCommandStep2Increments the tool call counter by the given delta.- Specified by:
toolCallsin interfaceUpdateAgentInstanceCommandStep1.UpdateAgentInstanceCommandStep2- Parameters:
toolCalls- the number of tool calls to add. Must be >= 0.- Returns:
- this builder for method chaining
-
tools
public UpdateAgentInstanceCommandStep1.UpdateAgentInstanceCommandStep2 tools(List<UpdateAgentInstanceCommandStep1.AgentTool> tools) Description copied from interface:UpdateAgentInstanceCommandStep1.UpdateAgentInstanceCommandStep2Replaces the full list of tools available to the agent instance. An empty list clears all tools. UseUpdateAgentInstanceCommandStep1.AgentTool.of(String)orUpdateAgentInstanceCommandStep1.AgentTool.of(String, String, String)to construct tool entries.Example:
.tools(List.of( AgentTool.of("search", "Search the web", "searchTask"), AgentTool.of("summarize") ))- Specified by:
toolsin interfaceUpdateAgentInstanceCommandStep1.UpdateAgentInstanceCommandStep2- Parameters:
tools- the tools to set; pass an empty list to clear all tools- Returns:
- this builder for method chaining
-
requestTimeout
public UpdateAgentInstanceCommandStep1.UpdateAgentInstanceCommandStep2 requestTimeout(Duration requestTimeout) Description copied from interface:FinalCommandStepSets the request timeout for the command. The default request timeout can be configured usingCamundaClientBuilder.defaultRequestTimeout(Duration).- Specified by:
requestTimeoutin interfaceFinalCommandStep<UpdateAgentInstanceResponse>- Parameters:
requestTimeout- the request timeout- Returns:
- the configured command
-
send
Description copied from interface:FinalCommandStepSends the command to the Camunda gateway. This operation is asynchronous. In case of success, the future returns the event that was generated by the Camunda gateway in response to the command.Call
CamundaFuture.join()to wait until the response is available.Future<JobEventinvalid input: '>' future = command.send(); JobEvent event = future.join();- Specified by:
sendin interfaceFinalCommandStep<UpdateAgentInstanceResponse>- Returns:
- a future tracking state of success/failure of the command.
-