llm_chat_with_json_output
llm_chat_with_json_output: Structured JSON Responses
llm_chat_with_json_output: Structured JSON ResponsesGets structured JSON responses from the language model according to a specified schema.
def llm_chat_with_json_output(
agent_name: str,
messages: List[Dict[str, Any]],
base_url: str = aios_kernel_url,
llms: List[Dict[str, Any]] = None,
response_format: Dict[str, Dict] = None
) -> LLMResponseParameters:
agent_name: Identifier for the agent making the requestmessages: List of message dictionariesbase_url: API endpoint URLllms: Optional list of LLM configurationsresponse_format: JSON schema specifying the required output format
Returns:
LLMResponseobject containing the structured JSON response
Example:
Last updated