Skip to content

Commit

Permalink
removed calls to openai
Browse files Browse the repository at this point in the history
  • Loading branch information
RalphHuber committed Sep 30, 2023
1 parent 59882db commit a9b17c7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 18 deletions.
16 changes: 5 additions & 11 deletions interviewkit/interview.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from random import choice
from interviewee import Interviewee
import openai
from enum import StrEnum, auto


Expand Down Expand Up @@ -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]
Expand Down
6 changes: 0 additions & 6 deletions interviewkit/main.py
Original file line number Diff line number Diff line change
@@ -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")
Expand Down
3 changes: 2 additions & 1 deletion interviewkit/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@


class Settings(BaseSettings):
OPENAI_API_KEY: str
#TODO
pass

0 comments on commit a9b17c7

Please sign in to comment.