Update app.py
Browse files
app.py
CHANGED
|
@@ -54,10 +54,14 @@ def analyze_attrition_with_llm(df_dict, hr_query):
|
|
| 54 |
],
|
| 55 |
function_call="auto"
|
| 56 |
)
|
|
|
|
| 57 |
|
| 58 |
-
#
|
| 59 |
-
|
| 60 |
-
|
|
|
|
|
|
|
|
|
|
| 61 |
|
| 62 |
with gr.Blocks() as demo:
|
| 63 |
gr.Markdown("<h1>AI-Driven Employee Attrition Risk Analysis</h1>")
|
|
|
|
| 54 |
],
|
| 55 |
function_call="auto"
|
| 56 |
)
|
| 57 |
+
print(response) # Debugging: Print response
|
| 58 |
|
| 59 |
+
# Handle function call response properly
|
| 60 |
+
if response.choices[0].message.function_call:
|
| 61 |
+
function_args = json.loads(response.choices[0].message.function_call.arguments)
|
| 62 |
+
return predict_attrition_risk(**function_args)
|
| 63 |
+
else:
|
| 64 |
+
return "🤖 No response generated."
|
| 65 |
|
| 66 |
with gr.Blocks() as demo:
|
| 67 |
gr.Markdown("<h1>AI-Driven Employee Attrition Risk Analysis</h1>")
|