From 59882db4ddd78d35eba7de816691ceabacb234bb Mon Sep 17 00:00:00 2001 From: Ralph Sinnhuber Date: Tue, 26 Sep 2023 20:16:01 +0100 Subject: [PATCH 1/3] removed open ai in requirements files --- pyproject.toml | 1 - requirements.txt | 1 - 2 files changed, 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 38cabd7..8a30e47 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,6 @@ license= "GPL-2.0-or-later" [tool.poetry.dependencies] python = "^3.11" -openai = "^0.28.0" pydantic-settings = "^2.0.3" pydantic = "^2.3.0" diff --git a/requirements.txt b/requirements.txt index 2b1d921..c917489 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,7 +8,6 @@ colorama==0.4.6 frozenlist==1.4.0 idna==3.4 multidict==6.0.4 -openai==0.28.0 requests==2.31.0 tqdm==4.66.1 urllib3==2.0.5 From a9b17c708281519dbfd827cdd5136b16f9239c51 Mon Sep 17 00:00:00 2001 From: Ralph Sinnhuber Date: Tue, 26 Sep 2023 20:33:16 +0100 Subject: [PATCH 2/3] removed calls to openai --- interviewkit/interview.py | 16 +++++----------- interviewkit/main.py | 6 ------ interviewkit/settings.py | 3 ++- 3 files changed, 7 insertions(+), 18 deletions(-) diff --git a/interviewkit/interview.py b/interviewkit/interview.py index a5d579b..0593e87 100644 --- a/interviewkit/interview.py +++ b/interviewkit/interview.py @@ -1,6 +1,5 @@ from random import choice from interviewee import Interviewee -import openai from enum import StrEnum, auto @@ -40,20 +39,15 @@ def stop_transcription(self) -> None: self.transcript = " ".join(self.transcript) def suggest_questions(self) -> str: - """Use the OpenAI API to suggest questions based on the transcript content.""" + """suggest questions based on the transcript content.""" suggested_questions = self.generate_questions(self.transcript) return suggested_questions def generate_questions(self, content: str) -> list[str]: - """Call the OpenAI API to generate questions, and return them.""" - response = openai.Completion.create( - engine="text-davinci-002", - prompt=f"Generate interview questions based on the following transcript:\n{content}\n", - max_tokens=50, # Adjust the max tokens as needed - n=5, # Number of questions to generate - stop=None, - temperature=0.7, # Adjust the temperature for creativity - ) + """generate questions, and return them.""" + + #TODO + response = None # Extract and return the generated questions generated_questions = [choice["text"].strip() for choice in response.choices] diff --git a/interviewkit/main.py b/interviewkit/main.py index c960be0..05e0b43 100644 --- a/interviewkit/main.py +++ b/interviewkit/main.py @@ -1,17 +1,11 @@ import os -import openai - from interview import Interview from interviewee import Interviewee from transcript import Transcript from settings import Settings - -# Set the OpenAI API key settings = Settings() -openai.api_key = settings.OPENAI_API_KEY - if __name__ == "__main__": interviewee = Interviewee("John Doe", 60, "Male") diff --git a/interviewkit/settings.py b/interviewkit/settings.py index cd143e2..8a630f2 100644 --- a/interviewkit/settings.py +++ b/interviewkit/settings.py @@ -2,4 +2,5 @@ class Settings(BaseSettings): - OPENAI_API_KEY: str + #TODO + pass \ No newline at end of file From 242898a90e4f9922b124bd04f1663a3d27ae3a0f Mon Sep 17 00:00:00 2001 From: Ralph Sinnhuber Date: Sat, 30 Sep 2023 14:25:03 +0100 Subject: [PATCH 3/3] main() now running --- interviewkit/interview.py | 5 +++-- interviewkit/interviewee.py | 3 +-- interviewkit/main.py | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/interviewkit/interview.py b/interviewkit/interview.py index 0593e87..bdab42e 100644 --- a/interviewkit/interview.py +++ b/interviewkit/interview.py @@ -1,6 +1,7 @@ from random import choice from interviewee import Interviewee from enum import StrEnum, auto +from transcript import Transcript class Status(StrEnum): @@ -13,7 +14,7 @@ class Status(StrEnum): class Interview(object): """An interview between an Interviewee and an Interviewer.""" - def __init__(self, interviewee: Interviewee): + def __init__(self, interviewee: Interviewee, transcript: Transcript): self.interviewee = interviewee self.status = Status.IN_PROGRESS @@ -26,8 +27,8 @@ def stop_recording(self) -> None: self.status = Status.RECORDED def start_transcription(self) -> None: + print("transcribing") self.status = "Transcribing" - self.transcript = [] # TODO: Use object Transcript instead of list? def add_to_transcript(self, speech: str) -> None: self.transcript.append(speech) diff --git a/interviewkit/interviewee.py b/interviewkit/interviewee.py index a16c17e..821d21e 100644 --- a/interviewkit/interviewee.py +++ b/interviewkit/interviewee.py @@ -1,7 +1,6 @@ from enum import StrEnum, auto from pydantic import BaseModel, NonNegativeInt - class Gender(StrEnum): MALE = auto() FEMALE = auto() @@ -13,4 +12,4 @@ class Interviewee(BaseModel): name: str age: NonNegativeInt - gender: Gender + gender: Gender \ No newline at end of file diff --git a/interviewkit/main.py b/interviewkit/main.py index 05e0b43..33fa282 100644 --- a/interviewkit/main.py +++ b/interviewkit/main.py @@ -1,20 +1,20 @@ import os from interview import Interview -from interviewee import Interviewee +from interviewee import Interviewee, Gender from transcript import Transcript from settings import Settings settings = Settings() if __name__ == "__main__": - interviewee = Interviewee("John Doe", 60, "Male") + interviewee = Interviewee(name="John Doe", age=60, gender=Gender.MALE) transcript_content = "This is the content of the transcript." - transcript = Transcript(transcript_content) + transcript = Transcript(content=transcript_content) interview = Interview(interviewee, transcript) - interview.transcribe() + interview.start_transcription() print(f"Interview Status: {interview.status}")