Skip to content

Missing API key in the query_data.py script? #27

@Jmahxyz

Description

@Jmahxyz

When trying to run the query_data.py script, I kept getting the following errors:

Did not find openai_api_key, please add an environment variable OPENAI_API_KEY which contains it, or pass openai_api_key as a named parameter. (type=value_error)

After consulting claude, I added these lines (copied from the create_database.py) into the query script.

from dotenv import load_dotenv
import os

Load environment variables. Assumes that project contains .env file with API keys

load_dotenv()

Adding this worked and I am able to query the database. Not really a developer, so I am not sure if this is the best way to fix this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions