Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -7,6 +7,19 @@ app = FastAPI()
|
|
7 |
org = os.getenv("org")
|
8 |
OPENAI_API_KEY = os.getenv("open_ai")
|
9 |
client = OpenAI(api_key=OPENAI_API_KEY, organization=org)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
@app.post("/get_questions")
|
11 |
async def getQuestions(job_description: str, no_of_questions: int):
|
12 |
response = client.chat.completions.create(
|
|
|
7 |
org = os.getenv("org")
|
8 |
OPENAI_API_KEY = os.getenv("open_ai")
|
9 |
client = OpenAI(api_key=OPENAI_API_KEY, organization=org)
|
10 |
+
|
11 |
+
description = """
|
12 |
+
## As part of the project, we need to implement a FastAPI endpoint that takes a string as input and returns a list of questions along with their corresponding answers. This endpoint will be used to generate questions from text data.
|
13 |
+
|
14 |
+
Details:
|
15 |
+
Input: A string containing the input text.
|
16 |
+
Output: A JSON response containing a list of questions and a corresponding list of answers.
|
17 |
+
"""
|
18 |
+
|
19 |
+
app = FastAPI(docs_url="/", description=description)
|
20 |
+
|
21 |
+
|
22 |
+
|
23 |
@app.post("/get_questions")
|
24 |
async def getQuestions(job_description: str, no_of_questions: int):
|
25 |
response = client.chat.completions.create(
|