Skip to content

Retrying relevance score prompt if score was a float or response isn't valid JSON #749

@jamesbraza

Description

@jamesbraza

Our LLM response --> Context logic is a bit fragile:

What currently happens is this blows up Docs.aquery.

However, this should not be a critical failure because:

  1. It's not in the caller's (e.g. an agent) control, it's a failure internal to paper-qa.
  2. We can retry the summary prompt once or twice, saying something like:
    • "We failed to parse valid JSON according to exception {exc!r}. Please respond with JSON."
    • "We failed to extract a valid score according to exception {exc!r}. Please provide an integer score in 1-10."

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions