Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -26,7 +26,7 @@ load_dotenv()
|
|
| 26 |
|
| 27 |
client = AzureOpenAI(
|
| 28 |
api_key=os.getenv("OPENAI_API_KEY"),
|
| 29 |
-
api_version="2024-
|
| 30 |
azure_endpoint = "https://amplifai-openai.openai.azure.com/"
|
| 31 |
)
|
| 32 |
|
|
@@ -49,13 +49,13 @@ class GenerateResponse3(BaseModel):
|
|
| 49 |
text: List[Dict[str, str]]
|
| 50 |
class GenerateResponse4(BaseModel):
|
| 51 |
text: list
|
| 52 |
-
|
| 53 |
#Summarize function
|
| 54 |
def summarize_text(text: str):
|
| 55 |
-
response = client.completions.create(
|
| 56 |
model = deployment_name,
|
| 57 |
#engine="AmplifAI-Chat",
|
| 58 |
-
|
| 59 |
temperature=0.7,
|
| 60 |
max_tokens=750,
|
| 61 |
top_p=1.0,
|
|
|
|
| 26 |
|
| 27 |
client = AzureOpenAI(
|
| 28 |
api_key=os.getenv("OPENAI_API_KEY"),
|
| 29 |
+
api_version="2024-05-01-preview",
|
| 30 |
azure_endpoint = "https://amplifai-openai.openai.azure.com/"
|
| 31 |
)
|
| 32 |
|
|
|
|
| 49 |
text: List[Dict[str, str]]
|
| 50 |
class GenerateResponse4(BaseModel):
|
| 51 |
text: list
|
| 52 |
+
|
| 53 |
#Summarize function
|
| 54 |
def summarize_text(text: str):
|
| 55 |
+
response = client.chat.completions.create(
|
| 56 |
model = deployment_name,
|
| 57 |
#engine="AmplifAI-Chat",
|
| 58 |
+
messages="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,
|
| 59 |
temperature=0.7,
|
| 60 |
max_tokens=750,
|
| 61 |
top_p=1.0,
|