This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pip install Cassandra-driver openai | |
from cassandra.cluster import Cluster | |
import openai | |
def generate_text_with_llm(prompt): | |
# OpenAI API configuration | |
openai.api_key = "your_openai_api_key" | |
# Generate text using OpenAI's LLM |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mysql.connector | |
import openai | |
def generate_text_with_llm(prompt): | |
# OpenAI API configuration | |
openai.api_key = "your_openai_api_key" | |
# Generate text using OpenAI's LLM | |
response = openai.Completion.create( | |
engine="davinci", # Choose the appropriate engine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pip install mysql-connector-python openai | |
import mysql.connector | |
import openai | |
def fetch_data_from_mysql(): | |
# MySQL database configuration | |
db_config = { | |
"host": "your_host", | |
"user": "your_username", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import mysql.connector | |
import openai | |
# MySQL database settings | |
MYSQL_HOST = 'your_mysql_host' | |
MYSQL_USER = 'your_mysql_user' | |
MYSQL_PASSWORD = 'your_mysql_password' | |
MYSQL_DATABASE = 'your_mysql_database' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import pickle | |
import pandas as pd | |
from googleapiclient.discovery import build | |
from google_auth_oauthlib.flow import InstalledAppFlow | |
from google.auth.transport.requests import Request | |
import openai | |
# Google Drive API settings | |
SCOPES_DRIVE = ['https://www.googleapis.com/auth/drive.readonly'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import pickle | |
from googleapiclient.discovery import build | |
from google_auth_oauthlib.flow import InstalledAppFlow | |
from google.auth.transport.requests import Request | |
# If modifying these SCOPES, delete the token.pickle file. | |
SCOPES = ['https://www.googleapis.com/auth/drive.metadata.readonly'] | |
def authenticate_google_drive(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import pickle | |
from googleapiclient.discovery import build | |
from googleapiclient.http import MediaIoBaseDownload | |
from google_auth_oauthlib.flow import InstalledAppFlow | |
from google.auth.transport.requests import Request | |
# If modifying these SCOPES, delete the token.pickle file. | |
SCOPES = ['https://www.googleapis.com/auth/drive.readonly'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Define your OpenAI API key | |
const OPENAI_API_KEY = 'YOUR_OPENAI_API_KEY'; | |
// This function makes a request to the OpenAI API | |
function generateOpenAIResponse(prompt) { | |
const apiUrl = 'https://api.openai.com/v1/engines/davinci-codex/completions'; | |
const headers = { | |
Authorization: `Bearer ${OPENAI_API_KEY}`, | |
'Content-Type': 'application/json', | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def hello(): | |
print("Hello Gist!") |