Package com.aispect.agents.data
Class JsonExtractorAgent
- All Implemented Interfaces:
AiAgentFilter,AiExceptionProxy<Object,,String> AiExecutionProxy<Object,,String> AiPostExecutionProxy<Object,,String> AiPreExecutionProxy<Object>,AiUnitAgentHandler<Object,String>
JSON extract Agent。
For extracting from unstructured, cluttered text JSON string. It short-circuits the original method execution, passing the input text to AI parses and returns only valid JSON string.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexecute(AiInvocationContext<Object> ctx) implement JSON Extract the core logic.Methods inherited from class com.aispect.agent.core.AbstractUnitAgent
doFilter, getAiOperations, onException, postExecute, preExecute, shouldProcess
-
Constructor Details
-
JsonExtractorAgent
public JsonExtractorAgent()
-
-
Method Details
-
execute
implement JSON Extract the core logic.- Specified by:
executein interfaceAiExecutionProxy<Object,String> - Overrides:
executein classAbstractUnitAgent<Object,String> - Parameters:
ctx- AI Execution context, including method input parameters and other information- Returns:
- Extracted and cleaned pure JSON string
- Throws:
AiSpectException- if AI An error occurred during the calling process or parsing process
-