From 94d197e0025491515654fccd36d28f10caa1980a Mon Sep 17 00:00:00 2001 From: Hitesh Ghuge <41512916+hiteshghuge@users.noreply.github.com> Date: Tue, 23 Jul 2024 13:36:34 +0530 Subject: [PATCH] - Changing message if agent not available (#1364) * - Changing message if agent not available * - Changing message if agent not available * - Changing message if agent not available * - Changing message if agent not available * - Changing message if agent not available * - Changing message if agent not available * - Adding gpt-4o-mini --------- Co-authored-by: hghuge --- kairon/api/models.py | 3 +- metadata/integrations.yml | 2 +- tests/integration_test/services_test.py | 4 +- .../history/conversations_history2.json | 42 +++++++++---------- 4 files changed, 25 insertions(+), 26 deletions(-) diff --git a/kairon/api/models.py b/kairon/api/models.py index 0211e5ed7..1e6671ebc 100644 --- a/kairon/api/models.py +++ b/kairon/api/models.py @@ -490,14 +490,13 @@ class LiveAgentActionRequest(BaseModel): bot_response: str = 'Connecting to live agent' agent_connect_response: str = 'Connected to live agent' agent_disconnect_response: str = 'Agent has closed the conversation' - agent_not_available_response: str = 'No agents available at this moment. An agent will reply you shortly.' + agent_not_available_response: str = 'No agents available at this moment. An agent will reply to you shortly.' dispatch_bot_response: bool = True dispatch_agent_connect_response: bool = True dispatch_agent_disconnect_response: bool = True dispatch_agent_not_available_response: bool = True - class TrainingData(BaseModel): intent: constr(to_lower=True, strip_whitespace=True) training_examples: List[str] diff --git a/metadata/integrations.yml b/metadata/integrations.yml index 9a1efbe2d..9b8097e66 100644 --- a/metadata/integrations.yml +++ b/metadata/integrations.yml @@ -115,7 +115,7 @@ llm: model: type: string default: "gpt-3.5-turbo" - enum: ["gpt-3.5-turbo", "gpt-3.5-turbo-instruct"] + enum: ["gpt-3.5-turbo", "gpt-3.5-turbo-instruct", "gpt-4o-mini"] description: "The model hyperparameter is the ID of the model to use such as gpt-2, gpt-3, or a custom model that you have trained or fine-tuned." top_p: type: number diff --git a/tests/integration_test/services_test.py b/tests/integration_test/services_test.py index 89214ff88..fa4624a00 100644 --- a/tests/integration_test/services_test.py +++ b/tests/integration_test/services_test.py @@ -1684,7 +1684,7 @@ def test_get_live_agent_after_enabled(): assert actual["data"] == {'name': 'live_agent_action', 'bot_response': 'connecting to live agent', 'agent_connect_response': 'Connected to live agent', 'agent_disconnect_response': 'Agent has closed the conversation', - 'agent_not_available_response': 'No agents available at this moment. An agent will reply you shortly.', + 'agent_not_available_response': 'No agents available at this moment. An agent will reply to you shortly.', 'dispatch_bot_response': False, 'dispatch_agent_connect_response': True, 'dispatch_agent_disconnect_response': True, 'dispatch_agent_not_available_response': True} assert actual["error_code"] == 0 @@ -1740,7 +1740,7 @@ def test_get_live_agent_after_updated(): 'bot_response': 'connecting to different live agent...', 'agent_connect_response': 'Connected to live agent', 'agent_disconnect_response': 'Agent has closed the conversation', - 'agent_not_available_response': 'No agents available at this moment. An agent will reply you shortly.', + 'agent_not_available_response': 'No agents available at this moment. An agent will reply to you shortly.', 'dispatch_bot_response': True, 'dispatch_agent_connect_response': True, 'dispatch_agent_disconnect_response': True, diff --git a/tests/testing_data/history/conversations_history2.json b/tests/testing_data/history/conversations_history2.json index 706d10d9c..7fc7e960d 100644 --- a/tests/testing_data/history/conversations_history2.json +++ b/tests/testing_data/history/conversations_history2.json @@ -1473,7 +1473,7 @@ "event": { "event": "bot", "timestamp": 1716351959.100689, - "text": "No agents available at this moment. An agent will reply you shortly.", + "text": "No agents available at this moment. An agent will reply to you shortly.", "metadata": { "type": "live_agent", "event_type": "no_agent_available_live_agent" @@ -1515,7 +1515,7 @@ "model_id": "c6bbb5f62f454f84b39001298d084dec", "assistant_id": "663f39ebbec36aebd2a070a2" }, - "text": "No agents available at this moment. An agent will reply you shortly.", + "text": "No agents available at this moment. An agent will reply to you shortly.", "data": { "elements": null, "quick_replies": null, @@ -1551,7 +1551,7 @@ ], "bot_response": [ { - "text": "No agents available at this moment. An agent will reply you shortly.", + "text": "No agents available at this moment. An agent will reply to you shortly.", "data": { "elements": null, "quick_replies": null, @@ -2783,7 +2783,7 @@ "event": { "event": "bot", "timestamp": 1716388529.987211, - "text": "No agents available at this moment. An agent will reply you shortly.", + "text": "No agents available at this moment. An agent will reply to you shortly.", "metadata": { "type": "live_agent", "event_type": "no_agent_available_live_agent" @@ -2825,7 +2825,7 @@ "model_id": "c6bbb5f62f454f84b39001298d084dec", "assistant_id": "663f39ebbec36aebd2a070a2" }, - "text": "No agents available at this moment. An agent will reply you shortly.", + "text": "No agents available at this moment. An agent will reply to you shortly.", "data": { "elements": null, "quick_replies": null, @@ -2861,7 +2861,7 @@ ], "bot_response": [ { - "text": "No agents available at this moment. An agent will reply you shortly.", + "text": "No agents available at this moment. An agent will reply to you shortly.", "data": { "elements": null, "quick_replies": null, @@ -3301,7 +3301,7 @@ "event": { "event": "bot", "timestamp": 1716388811.196002, - "text": "No agents available at this moment. An agent will reply you shortly.", + "text": "No agents available at this moment. An agent will reply to you shortly.", "metadata": { "type": "live_agent", "event_type": "no_agent_available_live_agent" @@ -3537,7 +3537,7 @@ "event": { "event": "bot", "timestamp": 1716388866.974006, - "text": "No agents available at this moment. An agent will reply you shortly.", + "text": "No agents available at this moment. An agent will reply to you shortly.", "metadata": { "type": "live_agent", "event_type": "no_agent_available_live_agent" @@ -3553,7 +3553,7 @@ "model_id": "c6bbb5f62f454f84b39001298d084dec", "assistant_id": "663f39ebbec36aebd2a070a2" }, - "text": "No agents available at this moment. An agent will reply you shortly.", + "text": "No agents available at this moment. An agent will reply to you shortly.", "data": { "elements": null, "quick_replies": null, @@ -3589,7 +3589,7 @@ ], "bot_response": [ { - "text": "No agents available at this moment. An agent will reply you shortly.", + "text": "No agents available at this moment. An agent will reply to you shortly.", "data": { "elements": null, "quick_replies": null, @@ -8475,7 +8475,7 @@ "event": { "event": "bot", "timestamp": 1717047148.543667, - "text": "No agents available at this moment. An agent will reply you shortly.", + "text": "No agents available at this moment. An agent will reply to you shortly.", "metadata": { "type": "live_agent", "event_type": "no_agent_available_live_agent" @@ -8517,7 +8517,7 @@ "model_id": "c6bbb5f62f454f84b39001298d084dec", "assistant_id": "663f39ebbec36aebd2a070a2" }, - "text": "No agents available at this moment. An agent will reply you shortly.", + "text": "No agents available at this moment. An agent will reply to you shortly.", "data": { "elements": null, "quick_replies": null, @@ -8553,7 +8553,7 @@ ], "bot_response": [ { - "text": "No agents available at this moment. An agent will reply you shortly.", + "text": "No agents available at this moment. An agent will reply to you shortly.", "data": { "elements": null, "quick_replies": null, @@ -14559,7 +14559,7 @@ "event": { "event": "bot", "timestamp": 1717582831.745893, - "text": "No agents available at this moment. An agent will reply you shortly.", + "text": "No agents available at this moment. An agent will reply to you shortly.", "metadata": { "type": "live_agent", "event_type": "no_agent_available_live_agent" @@ -14601,7 +14601,7 @@ "model_id": "077b2eba7e914265a58bf00db5d9b9ad", "assistant_id": "663f39ebbec36aebd2a070a2" }, - "text": "{'action': 'live_agent', 'response': 'No agents available at this moment. An agent will reply you shortly.'}", + "text": "{'action': 'live_agent', 'response': 'No agents available at this moment. An agent will reply to you shortly.'}", "data": { "elements": null, "quick_replies": null, @@ -14637,7 +14637,7 @@ ], "bot_response": [ { - "text": "{'action': 'live_agent', 'response': 'No agents available at this moment. An agent will reply you shortly.'}", + "text": "{'action': 'live_agent', 'response': 'No agents available at this moment. An agent will reply to you shortly.'}", "data": { "elements": null, "quick_replies": null, @@ -16173,7 +16173,7 @@ "event": { "event": "bot", "timestamp": 1717584757.844307, - "text": "No agents available at this moment. An agent will reply you shortly.", + "text": "No agents available at this moment. An agent will reply to you shortly.", "metadata": { "type": "live_agent", "event_type": "no_agent_available_live_agent" @@ -19948,7 +19948,7 @@ "event": { "event": "bot", "timestamp": 1718088079.308141, - "text": "No agents available at this moment. An agent will reply you shortly.", + "text": "No agents available at this moment. An agent will reply to you shortly.", "metadata": { "type": "live_agent", "event_type": "no_agent_available_live_agent" @@ -19990,7 +19990,7 @@ "model_id": "077b2eba7e914265a58bf00db5d9b9ad", "assistant_id": "663f39ebbec36aebd2a070a2" }, - "text": "No agents available at this moment. An agent will reply you shortly.", + "text": "No agents available at this moment. An agent will reply to you shortly.", "data": { "elements": null, "quick_replies": null, @@ -20026,7 +20026,7 @@ ], "bot_response": [ { - "text": "No agents available at this moment. An agent will reply you shortly.", + "text": "No agents available at this moment. An agent will reply to you shortly.", "data": { "elements": null, "quick_replies": null, @@ -21804,7 +21804,7 @@ "event": { "event": "bot", "timestamp": 1718098710.52083, - "text": "No agents available at this moment. An agent will reply you shortly.", + "text": "No agents available at this moment. An agent will reply to you shortly.", "metadata": { "type": "live_agent", "event_type": "no_agent_available_live_agent"