Spaces:
Sleeping
Sleeping
changes to validate call flow
Browse files
app.py
CHANGED
|
@@ -256,9 +256,12 @@ def check_agent_steps(text: str):
|
|
| 256 |
"responses": []
|
| 257 |
}
|
| 258 |
for question in questions:
|
| 259 |
-
response =
|
| 260 |
-
|
| 261 |
-
|
|
|
|
|
|
|
|
|
|
| 262 |
temperature=0.2,
|
| 263 |
max_tokens=10,
|
| 264 |
top_p=1.0,
|
|
@@ -266,7 +269,7 @@ def check_agent_steps(text: str):
|
|
| 266 |
presence_penalty=0.0,
|
| 267 |
stop=["\n"]
|
| 268 |
)
|
| 269 |
-
answer = response.choices[0].
|
| 270 |
response_map = {
|
| 271 |
"lable": question,
|
| 272 |
"icon": answer
|
|
|
|
| 256 |
"responses": []
|
| 257 |
}
|
| 258 |
for question in questions:
|
| 259 |
+
response = client.chat.completions.create(
|
| 260 |
+
model = deployment_name,
|
| 261 |
+
messages=[
|
| 262 |
+
{"role": "system", "content": "You are an AI assistant evaluating call center agent performance. Keep answers concise."},
|
| 263 |
+
{"role": "user", "content": f"Based on the transcript, did the agent follow this step: '{question}'?\nTranscript: {text}\nAnswer with 'Right' or 'Wrong' only:"}
|
| 264 |
+
],
|
| 265 |
temperature=0.2,
|
| 266 |
max_tokens=10,
|
| 267 |
top_p=1.0,
|
|
|
|
| 269 |
presence_penalty=0.0,
|
| 270 |
stop=["\n"]
|
| 271 |
)
|
| 272 |
+
answer = response.choices[0].message.content.strip()
|
| 273 |
response_map = {
|
| 274 |
"lable": question,
|
| 275 |
"icon": answer
|