Spaces:
Sleeping
Sleeping
client changes
Browse files
app.py
CHANGED
|
@@ -23,6 +23,8 @@ openai.api_base = "https://amplifai-openai.openai.azure.com/"
|
|
| 23 |
openai.api_version = "2023-07-01-preview"
|
| 24 |
# openai.api_version = "2024-05-01-preview"
|
| 25 |
openai.api_key = os.getenv("OPENAI_API_KEY")
|
|
|
|
|
|
|
| 26 |
|
| 27 |
DEEPGRAM_API_KEY = os.getenv("DEEPGRAM_API_KEY")
|
| 28 |
if not DEEPGRAM_API_KEY:
|
|
@@ -44,7 +46,7 @@ class GenerateResponse4(BaseModel):
|
|
| 44 |
|
| 45 |
#Summarize function
|
| 46 |
def summarize_text(text: str):
|
| 47 |
-
response =
|
| 48 |
engine="AmplifAI-Chat",
|
| 49 |
prompt="The data is a pre-recorded conversation between a call center agent and a customer. Identify the following: keywords/metrics about the conversation, a summary of the conversation including details. Output should be in the format Keywords/Metrics: ,\n Summary:. \n Data: " + text,
|
| 50 |
temperature=0.7,
|
|
|
|
| 23 |
openai.api_version = "2023-07-01-preview"
|
| 24 |
# openai.api_version = "2024-05-01-preview"
|
| 25 |
openai.api_key = os.getenv("OPENAI_API_KEY")
|
| 26 |
+
from openai import OpenAI
|
| 27 |
+
client = OpenAI()
|
| 28 |
|
| 29 |
DEEPGRAM_API_KEY = os.getenv("DEEPGRAM_API_KEY")
|
| 30 |
if not DEEPGRAM_API_KEY:
|
|
|
|
| 46 |
|
| 47 |
#Summarize function
|
| 48 |
def summarize_text(text: str):
|
| 49 |
+
response = client.Completion.create(
|
| 50 |
engine="AmplifAI-Chat",
|
| 51 |
prompt="The data is a pre-recorded conversation between a call center agent and a customer. Identify the following: keywords/metrics about the conversation, a summary of the conversation including details. Output should be in the format Keywords/Metrics: ,\n Summary:. \n Data: " + text,
|
| 52 |
temperature=0.7,
|