Skip to content

Improve JSON extraction from LLM response #3211

Open
@mariofusco

Description

@mariofusco

The regexp based implementation used here to extract a JSON from the LLM response is not fully satisfying.

In particular it fails when you have a first spurious { or a [ in the LLM response not-related to the actual JSON that anyway can be present later in the same response, but in this case cannot be correctly recognized.

This can be made more robust and also cover this scenario. The same implementation could be used in the output guardrail used for the same purpose when it will be merged.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions