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

Parsing Error when receiving OpenAI response #2427

Open
dantgw opened this issue Jan 17, 2025 · 2 comments
Open

Parsing Error when receiving OpenAI response #2427

dantgw opened this issue Jan 17, 2025 · 2 comments
Labels

Comments

@dantgw
Copy link

dantgw commented Jan 17, 2025

Describe the bug
When having a conversation with the trump bot, I got this error.
Error parsing JSON: SyntaxError: Expected ',' or '}' after property value in JSON at position

at JSON.parse ()
at parseJsonArrayFromText ()

The response is an array with multiple objects:

 [
{
    "claim": "Under Trump's leadership, America will become the leader in crypto.",
    "type": "opinion",
    "in_bio": false,
    "already_known": false
  },
  {
    "claim": "Trump is always ready to make America great again, even in the digital world.",
    "type": "opinion",
    "in_bio": false,
    "already_known": false
  },
{
    "claim": "America is dominating the crypto space under Trump's leadership.",
    "type": "opinion",
    "in_bio": false,
    "already_known": false
  },
]

To Reproduce

Using the trump character, use OpenAI model and chat for a while.

Expected behavior

The parsing function should be robust enough to handle different responses from OpenAI.
It should be error free

@dantgw dantgw added the bug Something isn't working label Jan 17, 2025
Copy link
Contributor

Hello @dantgw! Welcome to the elizaOS community. Thank you for opening your first issue; we appreciate your contribution. You are now an elizaOS contributor!

@AIFlowML
Copy link
Collaborator

Hello @dantgw i the 1st time i see a parsing error.
what version are you running ?

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

No branches or pull requests

2 participants