Skip to content

Chakra-Network/customer-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Text Generation Example Based on Grounding and Recent Tweets

This script generates high-quality tweets in the style of a given set of "grounding" authors, based on themes from a set of "recent" tweets. It fetches the source tweets from a Snowflake database, uses the OpenAI API for generation, and outputs the results to a CSV file.

Setup

1. Install Dependencies

First, install the required Python libraries using pip:

pip install -r requirements.txt

2. Set up Environment Variables

This script requires credentials for both Snowflake and OpenAI. Create a file named .env in the project root and add the following, replacing the placeholder values with your actual credentials:

OPENAI_API_KEY="your_openai_api_key"
SNOWFLAKE_USER="your_snowflake_username"
SNOWFLAKE_PASSWORD="your_snowflake_password"
SNOWFLAKE_ACCOUNT="your_snowflake_account_identifier"
SNOWFLAKE_WAREHOUSE="your_snowflake_warehouse"
SNOWFLAKE_DATABASE="your_snowflake_database"
SNOWFLAKE_SCHEMA="your_snowflake_schema"

Usage

Run the script from the command line. By default, it will generate 5 tweets and save them to generated_tweets.csv.

python main.py

You can customize the output file and the number of tweets to generate using command-line arguments:

python main.py --output "my_awesome_tweets.csv" --num_tweets 10

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages