Class AgentResponseImpl
- All Implemented Interfaces:
AgentResponse,CloseableConnectorResponse,ConnectorResponse
AgentResponse.
Stores the agent output text returned by the connector execution and exposes it both through the generic parameter map (for BPMN output variable mapping) and through a typed getter method.
-
Field Summary
Fields inherited from class org.cibseven.connect.impl.AbstractConnectorResponse
responseParameters -
Constructor Summary
ConstructorsConstructorDescriptionAgentResponseImpl(String output) AgentResponseImpl(String output, String memoryId) AgentResponseImpl(String output, String memoryId, Map<String, Object> outputAiMeta, boolean stepCalledTools) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Once the engine has applied an AI agent service task's output parameters, stores the one that holds the AI-output marker itself Java-serialized, as the agentic ad hoc sub process does (CIB7-2819).protected voidcollectResponseParameters(Map<String, Object> responseParameters) To be implemented by subclasses for collecting the generic response parameters of a response.Returns the chat memory identifier used during this invocation, ornullwhen chat memory was not activated.Returns the final text response produced by the agent.Returns the EU AI Act Art.Methods inherited from class org.cibseven.connect.impl.AbstractConnectorResponse
getResponseParameter, getResponseParametersMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.cibseven.connect.spi.ConnectorResponse
getResponseParameter, getResponseParameters
-
Constructor Details
-
AgentResponseImpl
-
AgentResponseImpl
-
AgentResponseImpl
-
AgentResponseImpl
-
-
Method Details
-
collectResponseParameters
Description copied from class:AbstractConnectorResponseTo be implemented by subclasses for collecting the generic response parameters of a response.- Specified by:
collectResponseParametersin classAbstractConnectorResponse- Parameters:
responseParameters- a map to save the response parameters in
-
close
public void close()Once the engine has applied an AI agent service task's output parameters, stores the one that holds the AI-output marker itself Java-serialized, as the agentic ad hoc sub process does (CIB7-2819). Where JSON is the default format, the engine stores it as JSON, and Spin's map type detector names the marker's type after its first value, a Boolean: the variable could not be read back, nor could any read of all of the instance's variables.The connect plugin calls this right after it applied the output parameters, before the task is left, also after an output parameter failed; it logs an exception of this method and goes on. The marker is found by identity among the connector's output parameters, whatever their expression; a copy of it, or a map that holds it, stays as the engine stored it, and so does an activity's own output parameter, which the engine applies after this. Nothing happens unless the engine stored the marker as JSON (the default format, or the first one that can store a map where the default format cannot), outside a service task, where the agent's engine plugin did not parse the task, or where the engine cannot store the marker Java-serialized.
The variable is written twice in one command: one more variable update for listeners and conditional events, and at history level full one more history row. That first row keeps the engine's JSON; under the map type detector it does not read back, while the variable's history does.
- Specified by:
closein interfaceCloseableConnectorResponse
-
getOutput
Description copied from interface:AgentResponseReturns the final text response produced by the agent.- Specified by:
getOutputin interfaceAgentResponse
-
getOutputAiMeta
Description copied from interface:AgentResponseReturns the EU AI Act Art. 50(2) marker describing the AI-generated nature ofAgentResponse.getOutput(), ornullwhen no marker could be assembled (e.g. the agent returned no successful response).- Specified by:
getOutputAiMetain interfaceAgentResponse
-
getMemoryId
Description copied from interface:AgentResponseReturns the chat memory identifier used during this invocation, ornullwhen chat memory was not activated.- Specified by:
getMemoryIdin interfaceAgentResponse
-