def string_node()

in aidial_assistant/json_stream/json_parser.py [0:0]


def string_node(node: JsonNode) -> JsonString:
    if not isinstance(node, JsonString):
        raise TypeError(
            f"Expected json string at position {node.pos}, got {node.type()}"
        )

    return node