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

TypeError: Cannot use 'in' operator to search for 'bio' in undefined at validateJson (tweets2character.js:147:40) #12

Open
lifeeaseteam opened this issue Dec 26, 2024 · 3 comments

Comments

@lifeeaseteam
Copy link

Steps to Reproduce

  • Clone repository
  • Install dependencies with pnpm install
  • Run command: node scripts/tweets2character.js wb_twitter.zip

Environment
Node.js: v23.5.0
OS: Linux
Package Manager: pnpm

Technical Details

  • Concurrent processing fails across multiple chunks (0-8)
  • JSON validation fails when checking for 'bio' property
  • Error occurs in multiple functions: validateJson, extractInfo, runChatCompletion
@mintcloud
Copy link

Running in the same issues, please fix, no idea of the workaround

Environment
Node.js: v23.3.0
OS: MacOs
Package Manager: pnpm

@suhel-rn
Copy link

suhel-rn commented Jan 6, 2025

Did you find a solution for this? Maybe a different version that works?

@suhel-rn
Copy link

suhel-rn commented Jan 6, 2025

The issue that I was able to find was that this is not related to the validateJson function, rather it is related to using the gpt-4o model using the free plan of OpenAI.

If you are using the API key from the free plan, clone the repository, and alter the model in the runChatCompletion function to gpt-4o-mini

Something like

const runChatCompletion = async (messages, useGrammar = false, model) => {
  if (model === 'openai') {
    const modelName = 'gpt-4o-mini';

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

3 participants