java.lang.Object
com.agentforge4j.runtime.llm.LlmCommandParser
Parses raw LLM output text into a list of
LlmCommands, validating each command's type
against the agent's CommandResponseSchema and required fields before binding.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionparse(String rawResponse, CommandResponseSchema schema) ParsesrawResponseinto commands allowed byschema.
-
Constructor Details
-
LlmCommandParser
public LlmCommandParser(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
-
Method Details
-
parse
ParsesrawResponseinto commands allowed byschema.- Parameters:
rawResponse- raw model output text, expected to contain a JSON array of command objectsschema- the calling agent's command schema, used to validate types and required fields- Returns:
- parsed commands in response order
- Throws:
LlmCommandParseException- if the output is not valid JSON, is not a non-empty JSON array, or any element names an unknown/disallowed type or fails binding
-