Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exercise #4 - Output Parser - OpenAI responds with schema instead of JSON #1

Open
bkieling opened this issue Aug 24, 2023 · 0 comments

Comments

@bkieling
Copy link

Hi,

when I run the excercise #4, OpenAI responds with a JSON schema containing the values. I could validate this in the ChatGPT UI:

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "actor": {
      "type": "string",
      "value": "Al Pacino"
    },
    "movies": {
      "type": "array",
      "items": [
        "The Panic in Needle Park (1971)",
        "The Godfather (1972)",
        "Serpico (1973)",
        "The Godfather Part II (1974)",
        "Dog Day Afternoon (1975)",
        "Bobby Deerfield (1977)",
        ...
      ]
    }
  }
}

If you instruct it to just return the JSON data, it works. Maybe the prompt template in BeanOutputParser.getFormat() should be adapted.

Regards,
Björn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant