Skip to main content

Interface: ParseJsonOptions<_T>

Defined in: packages/agentos/src/nlp/ai_utilities/IUtilityAI.ts:164

Options for safe JSON parsing.

Type Parameters

_T

_T = any

Properties

attemptFixWithLLM?

optional attemptFixWithLLM: boolean

Defined in: packages/agentos/src/nlp/ai_utilities/IUtilityAI.ts:166

If true, attempts to use an LLM to fix or extract JSON if standard parsing fails.


llmModelIdForFix?

optional llmModelIdForFix: string

Defined in: packages/agentos/src/nlp/ai_utilities/IUtilityAI.ts:168

Model ID to use for LLM-based fixing.


llmProviderIdForFix?

optional llmProviderIdForFix: string

Defined in: packages/agentos/src/nlp/ai_utilities/IUtilityAI.ts:170

Provider ID for the LLM fixer.


maxRepairAttempts?

optional maxRepairAttempts: number

Defined in: packages/agentos/src/nlp/ai_utilities/IUtilityAI.ts:177

Max repair attempts with LLM if schema validation fails.


targetSchema?

optional targetSchema: JSONSchemaObject

Defined in: packages/agentos/src/nlp/ai_utilities/IUtilityAI.ts:175

Optional JSON schema to validate the parsed object against. If validation fails, the method may return null or attempt to fix again.