Skip to content

Commit

Permalink
Improve code
Browse files Browse the repository at this point in the history
  • Loading branch information
gksoriginals committed Nov 23, 2023
1 parent 41e6e4c commit b5baf8c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions ops/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
OPENAI_API_KEY=""
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
openai
sounddevice
numpy
langchain
langchain
python-dotenv
3 changes: 0 additions & 3 deletions src/ai.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import os
import openai
from openai import OpenAI
from utils import generate_text_with_prompt
from langchain.document_loaders import DirectoryLoader


openai.api_key = 'your-api-key'

def generate_transcript(pdf_file, client: OpenAI):
prompt = "Generate a full transcript for an event. \
The transcript should start with a greeting and welcome to the event message. \
Expand Down
8 changes: 7 additions & 1 deletion src/main.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
import argparse
import ai
import os
import audio
import dotenv
from openai import OpenAI

client = OpenAI()
dotenv.load_dotenv("ops/.env")

client = OpenAI(
api_key=os.environ.get("OPENAI_API_KEY"),
)

def main():
parser = argparse.ArgumentParser(description='AI Event Host')
Expand Down

0 comments on commit b5baf8c

Please sign in to comment.