Skip to content

Adding a env file to the training_data_creator.py to allow API keys to be loaded as a environment variable #60

@purethunder110

Description

@purethunder110

Currently, in the scripts/training_data_creator.py , the API is being load using this function

def get_api_key(api_key_file="/home/thor_x_me/PycharmProjects/Lucknow-LLM-data/scripts/API_KEY.txt"):
    """
    :param api_key_file: Path of API key saved in a text file
    :return: API key string
    """
    with open(api_key_file) as key:
        api_key = key.read()
        return api_key


GOOGLE_API_KEY = get_api_key()

This code contain a local directory structure to the API_KEY.txt file which contain the API keys.

This Could be removed in favour of a .env file which can store the google API key and then this key can be added using the dotenv-python package

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions