Skip to content

JSON Parser

Version v1

The block expects string input that would be produced by blocks exposing Large Language Models (LLMs) and Visual Language Models (VLMs). Input is parsed to JSON, and its keys are exposed as block outputs.

Accepted formats: - valid JSON strings - JSON documents wrapped with Markdown tags (very common for GPT responses)

{"my": "json"}

Details regarding block behavior:

  • error_status is set True whenever at least one of expected_fields cannot be retrieved from input

  • in case of multiple markdown blocks with raw JSON content - only first will be parsed and returned, while error_status will remain False

Type identifier

Use the following identifier in step "type" field: roboflow_core/json_parser@v1to add the block as as step in your workflow.

Properties

Name Type Description Refs
name str The unique name of this step..
expected_fields List[str] List of expected JSON fields. error_status field name is reserved and cannot be used..

The Refs column marks possibility to parametrise the property with dynamic values available in workflow runtime. See Bindings for more info.

Available Connections

Check what blocks you can connect to JSON Parser in version v1.

The available connections depend on its binding kinds. Check what binding kinds JSON Parser in version v1 has.

Bindings
  • input

  • output

    • error_status (boolean): Boolean flag.
    • * (*): Equivalent of any element.
Example JSON definition of step JSON Parser in version v1
{
    "name": "<your_step_name_here>",
    "type": "roboflow_core/json_parser@v1",
    "raw_json": [
        "$steps.lmm.output"
    ],
    "expected_fields": [
        "field_a",
        "field_b"
    ]
}