From 4c11a0d828f7e51ebf153ee614490aa4007c2e0b Mon Sep 17 00:00:00 2001 From: Om Gate Date: Thu, 30 Jan 2025 20:03:04 +0530 Subject: [PATCH 01/12] feat: sales assistant agent --- backend/director/agents/sales_assistant.py | 219 +++++++++++++++++++++ backend/director/handler.py | 3 +- backend/director/tools/composio_tool.py | 29 ++- 3 files changed, 247 insertions(+), 4 deletions(-) create mode 100644 backend/director/agents/sales_assistant.py diff --git a/backend/director/agents/sales_assistant.py b/backend/director/agents/sales_assistant.py new file mode 100644 index 00000000..c03da05b --- /dev/null +++ b/backend/director/agents/sales_assistant.py @@ -0,0 +1,219 @@ +import logging +import json +import os +from director.agents.base import BaseAgent, AgentResponse, AgentStatus +from director.core.session import ( + Session, + MsgStatus, + TextContent, + ContextMessage, + RoleTypes + +) +from director.llm import get_default_llm +from director.llm.base import LLMResponseStatus + +from director.tools.videodb_tool import VideoDBTool +from director.tools.composio_tool import composio_tool, ToolsType + +logger = logging.getLogger(__name__) + +SALES_ASSISTANT_PARAMETER = { + "type": "object", + "properties": { + "video_id": { + "type": "string", + "description": "The ID of the sales call video", + }, + "collection_id": { + "type": "string", + "description": "The ID of the collection which the video belongs to" + }, + "prompt": { + "type": "string", + "description": "Additional information/query given by the user to make the appropriate action to take place" + } + }, + "required": ["video_id", "collection_id"] +} + + +SALES_ASSISTANT_PROMPT = """ + Under "transcript", transcript of a sales call video is present. + Under "user prompt", the user has given additional context or information given + Generate a sales summary from it and generate answers from the transcript for the following properties + + Following are the properties for which you need to find answers for and the Field type definition or the only possible answers to answer are given below + + Each field has a predefined format or set of possible values and can also have **default** property which needs to be used if a field is missing in transcript and user prompt: + + #### **Fields & Expected Answers** + Field: dealname + description: (The company or individuals name with whom we are making a deal with) + type: text (which says the name of person we are dealing with or the company) + default: Deal with John Doe + + Field: dealstage + Possible Answers: appointmentscheduled, qualifiedtobuy, presentationscheduled, decisionmakerboughtin, contractsent, closedwon, closedlost + default: appointmentscheduled + + Field: budget + type: text (which signifies a budget range for eg: $1500 - $2000, $10000, etc) + default: undisclosed + + Field: authority + Possible Answers: Decision Maker, Influencer, Champion, No Authority + default: Influencar + + Field: need + Possible Answers: Critical, Important, Nice to Have, Not a Fit + default: Important + + Field: timeline + Possible Answers: This Month, This Quarter, Next Quarter, Next Year,Uncertain + default: This Quarter + +If any field is missing in the transcript, return **'Unknown'** or any suitable value for it if the "default" is not present. + +""" + +class SalesAssistantAgent(BaseAgent): + def __init__(self, session: Session, **kwargs): + self.agent_name = "sales_assistant" + self.description = "This agent will transcribe sales calls, automatically create deal summaries & update CRM software like Salesforce & Hubspot" + self.parameters = SALES_ASSISTANT_PARAMETER + self.llm = get_default_llm() + super().__init__(session=session, **kwargs) + + + def _generate_prompt(self, transcript:str, prompt:str): + final_prompt = SALES_ASSISTANT_PROMPT + + final_prompt += f""" + "transcript": + {transcript} + + "user prompt": + {prompt} + """ + + return final_prompt + + def run(self, + video_id:str, + collection_id:str, + prompt="", + *args, + **kwargs + ) -> AgentResponse: + """ + Create deal summaries and update the users CRM software + + :param str video_id: The sales call video ID + :param str collection_id: The videos collection ID + :param str prompt: Additional context or query given by the user for the task + :param args: Additional positional arguments. + :param kwargs: Additional keyword arguments. + :return: The response containing information about the sample processing operation. + :rtype: AgentResponse + """ + try: + HUBSPOT_ACCESS_TOKEN = os.getenv("HUBSPOT_ACCESS_TOKEN") + + if not HUBSPOT_ACCESS_TOKEN: + return AgentResponse( + status=AgentStatus.ERROR, + message="Hubspot token not present" + ) + + text_content = TextContent( + agent_name=self.agent_name, + status=MsgStatus.progress, + status_message="Making magic happen with VideoDB Director..", + ) + + videodb_tool = VideoDBTool(collection_id=collection_id) + + self.output_message.actions.append("Extracting the transcript") + self.output_message.push_update() + + try: + transcript_text = videodb_tool.get_transcript(video_id) + except Exception: + logger.error("Transcript not found. Indexing spoken words..") + self.output_message.actions.append("Indexing spoken words..") + self.output_message.push_update() + videodb_tool.index_spoken_words(video_id) + transcript_text = videodb_tool.get_transcript(video_id) + + + self.output_message.actions.append("Processing the transcript") + self.output_message.push_update() + + sales_assist_llm_prompt = self._generate_prompt(transcript=transcript_text, prompt=prompt) + sales_assist_llm_message = ContextMessage( + content=sales_assist_llm_prompt, role=RoleTypes.user + ) + llm_response = self.llm.chat_completions([sales_assist_llm_message.to_llm_msg()]) + + if not llm_response.status: + logger.error(f"LLM failed with {llm_response}") + text_content.status = MsgStatus.error + text_content.status_message = "Failed to generate the response." + self.output_message.publish() + return AgentResponse( + status=AgentStatus.ERROR, + message="Sales assistant failed due to LLM error.", + ) + + composio_prompt = f""" + Create a new deal in HubSpot with the following details: + + --- + {llm_response.content} + --- + + Use the HUBSPOT_CREATE_CRM_OBJECT_WITH_PROPERTIES action to accomplish this. + """ + + self.output_message.actions.append("Adding it into the Hubspot CRM") + self.output_message.push_update() + + composio_response = composio_tool( + task=composio_prompt, + auth_data={ + "name": "HUBSPOT", + "token": HUBSPOT_ACCESS_TOKEN + }, + tools_type=ToolsType.actions + ) + + llm_prompt = ( + f"User has asked to run a task: {composio_prompt} in Composio. \n" + "Format the following reponse into text.\n" + "Give the output which can be directly send to use \n" + "Don't add any extra text \n" + f"{json.dumps(composio_response)}" + "If there are any errors or if it was not successful, do tell about that as well" + ) + composio_response = ContextMessage(content=llm_prompt, role=RoleTypes.user) + llm_response = self.llm.chat_completions([composio_response.to_llm_msg()]) + if llm_response.status == LLMResponseStatus.ERROR: + raise Exception(f"LLM Failed with error {llm_response.content}") + + text_content.text = llm_response.content + text_content.status = MsgStatus.success + text_content.status_message = "Here is the response from Composio" + + except Exception as e: + logger.exception(f"Error in {self.agent_name}") + text_content.status = MsgStatus.error + text_content.status_message = "Error in sales assistant" + self.output_message.publish() + error_message = f"Agent failed with error {e}" + return AgentResponse(status=AgentStatus.ERROR, message=error_message) + return AgentResponse( + status=AgentStatus.SUCCESS, + message=f"Agent {self.name} completed successfully.", + data={}, + ) diff --git a/backend/director/handler.py b/backend/director/handler.py index 3157cc4f..be90c531 100644 --- a/backend/director/handler.py +++ b/backend/director/handler.py @@ -25,7 +25,7 @@ from director.agents.transcription import TranscriptionAgent from director.agents.comparison import ComparisonAgent from director.agents.web_search_agent import WebSearchAgent - +from director.agents.sales_assistant import SalesAssistantAgent from director.core.session import Session, InputMessage, MsgStatus from director.core.reasoning import ReasoningEngine @@ -67,6 +67,7 @@ def __init__(self, db, **kwargs): ComposioAgent, ComparisonAgent, WebSearchAgent, + SalesAssistantAgent ] def add_videodb_state(self, session): diff --git a/backend/director/tools/composio_tool.py b/backend/director/tools/composio_tool.py index f35f8856..9b8ff57b 100644 --- a/backend/director/tools/composio_tool.py +++ b/backend/director/tools/composio_tool.py @@ -3,8 +3,14 @@ from director.llm.openai import OpenAIChatModel +from enum import Enum -def composio_tool(task: str): + +class ToolsType(str, Enum): + apps = "apps" + actions = "actions" + +def composio_tool(task: str, auth_data: dict = None, tools_type:ToolsType=ToolsType.apps): from composio_openai import ComposioToolSet from openai import OpenAI @@ -18,8 +24,25 @@ def composio_tool(task: str): openai_client = OpenAI(api_key=key, base_url=base_url) toolset = ComposioToolSet(api_key=os.getenv("COMPOSIO_API_KEY")) - tools = toolset.get_tools(apps=json.loads(os.getenv("COMPOSIO_APPS"))) - print(tools) + + if auth_data and "name" in auth_data and "token" in auth_data: + toolset.add_auth( + app=auth_data["name"].upper(), + parameters=[ + { + "name": "Authorization", + "in_": "header", + "value": f"Bearer {auth_data['token']}" + } + ] + ) + + if tools_type == ToolsType.apps: + tools = toolset.get_tools(apps=os.getenv("COMPOSIO_APPS")) + + elif tools_type == ToolsType.actions: + tools = toolset.get_tools(actions=os.getenv("COMPOSIO_ACTIONS")) + response = openai_client.chat.completions.create( model=OpenAIChatModel.GPT4o, From 509b6744a2f9cbeb51f4f883fc6a07c2114c8e59 Mon Sep 17 00:00:00 2001 From: Om Gate Date: Fri, 31 Jan 2025 15:18:04 +0530 Subject: [PATCH 02/12] feat: update prompt for multi line answers --- backend/director/agents/sales_assistant.py | 29 ++++++++++++++++------ 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/backend/director/agents/sales_assistant.py b/backend/director/agents/sales_assistant.py index c03da05b..0484b5c7 100644 --- a/backend/director/agents/sales_assistant.py +++ b/backend/director/agents/sales_assistant.py @@ -58,20 +58,33 @@ default: appointmentscheduled Field: budget - type: text (which signifies a budget range for eg: $1500 - $2000, $10000, etc) - default: undisclosed + type: Multi line text (Max words: 150) + description: + The multi line text answer for this field must consist of a detailed analysis of the budget situation of the company. + If numbers are mentioned, do include those details aswell. + If the deal is overpriced, underpriced or considered fair, should also be added if mentioned + Field: authority - Possible Answers: Decision Maker, Influencer, Champion, No Authority - default: Influencar + type: Multi line text (Max words: 150) + description: + The multi line text answer for this field must consist of a detailed analysis of the authority the client possesses for the conclusion of the deal. + If decision making powers are mentioned, do include those details. + If the client mention that they are the final signing authority, or any other details signifying their level of power in the deal. mention them + Field: need - Possible Answers: Critical, Important, Nice to Have, Not a Fit - default: Important + type: Multi line text (Max words: 150) + description: + The multi line text answer for this field must consist of a detailed analysis of how much the client wants the product. + Need can be found from the level or urgency, the depth or importance of problem they want to get solved or the amount of hurry they have + Field: timeline - Possible Answers: This Month, This Quarter, Next Quarter, Next Year,Uncertain - default: This Quarter + type: Multi line text (Max words: 150) + description: + The multi line text answer for this field must consist of a detailed analysis of how the timeline of the project looks like + Mention when they need the product, when they want to test the product etc. Important details about the timelines must be added here. If any field is missing in the transcript, return **'Unknown'** or any suitable value for it if the "default" is not present. From 877c4fb516ff1d7e95f285855ebe27e95f57f721 Mon Sep 17 00:00:00 2001 From: Om Gate Date: Fri, 31 Jan 2025 15:39:31 +0530 Subject: [PATCH 03/12] feat: prompt --- backend/director/agents/sales_assistant.py | 37 ++++++++++++++++++---- backend/director/tools/composio_tool.py | 4 +-- 2 files changed, 33 insertions(+), 8 deletions(-) diff --git a/backend/director/agents/sales_assistant.py b/backend/director/agents/sales_assistant.py index 0484b5c7..c96b527f 100644 --- a/backend/director/agents/sales_assistant.py +++ b/backend/director/agents/sales_assistant.py @@ -58,7 +58,7 @@ default: appointmentscheduled Field: budget - type: Multi line text (Max words: 150) + type: Multi line text (Around 150 words description) description: The multi line text answer for this field must consist of a detailed analysis of the budget situation of the company. If numbers are mentioned, do include those details aswell. @@ -66,7 +66,7 @@ Field: authority - type: Multi line text (Max words: 150) + type: Multi line text (Around 150 words description) description: The multi line text answer for this field must consist of a detailed analysis of the authority the client possesses for the conclusion of the deal. If decision making powers are mentioned, do include those details. @@ -74,22 +74,45 @@ Field: need - type: Multi line text (Max words: 150) + type: Multi line text (Around 150 words description) description: The multi line text answer for this field must consist of a detailed analysis of how much the client wants the product. Need can be found from the level or urgency, the depth or importance of problem they want to get solved or the amount of hurry they have Field: timeline - type: Multi line text (Max words: 150) + type: Multi line text (Around 150 words description) description: The multi line text answer for this field must consist of a detailed analysis of how the timeline of the project looks like Mention when they need the product, when they want to test the product etc. Important details about the timelines must be added here. -If any field is missing in the transcript, return **'Unknown'** or any suitable value for it if the "default" is not present. - """ +DUMMY_TRANSCRIPT = """ +[Sales Rep]: Hi John, thanks for taking the time today. I understand you're looking for a new CRM solution for Becket and Stones. + +[Client]: Yeah, our team is expanding, and we need something scalable. We want a system that integrates well with Salesforce. + +[Sales Rep]: That makes sense. Do you have a budget range in mind? + +[Client]: We're looking at something around **$12,500 to $17,500** annually. + +[Sales Rep]: Got it. Who will be making the final decision on this? + +[Client]: That would be me. I'm the **VP of Sales**, so I make the final call. + +[Sales Rep]: Great! Would you say this need is critical or just a nice-to-have? + +[Client]: It's **important**, but we could operate without it for now. + +[Sales Rep]: Understood. What's your timeline for making a decision? + +[Client]: We're planning for the **next quarter**. + +[Sales Rep]: Perfect! I'll schedule a presentation for next week to go over our solution in more detail. + +[Client]: Sounds good! +""" class SalesAssistantAgent(BaseAgent): def __init__(self, session: Session, **kwargs): self.agent_name = "sales_assistant" @@ -160,6 +183,8 @@ def run(self, transcript_text = videodb_tool.get_transcript(video_id) + # transcript_text = DUMMY_TRANSCRIPT + self.output_message.actions.append("Processing the transcript") self.output_message.push_update() diff --git a/backend/director/tools/composio_tool.py b/backend/director/tools/composio_tool.py index 9b8ff57b..665df8d4 100644 --- a/backend/director/tools/composio_tool.py +++ b/backend/director/tools/composio_tool.py @@ -38,10 +38,10 @@ def composio_tool(task: str, auth_data: dict = None, tools_type:ToolsType=ToolsT ) if tools_type == ToolsType.apps: - tools = toolset.get_tools(apps=os.getenv("COMPOSIO_APPS")) + tools = toolset.get_tools(apps=json.loads(os.getenv("COMPOSIO_APPS"))) elif tools_type == ToolsType.actions: - tools = toolset.get_tools(actions=os.getenv("COMPOSIO_ACTIONS")) + tools = toolset.get_tools(actions=json.loads(os.getenv("COMPOSIO_ACTIONS"))) response = openai_client.chat.completions.create( From 9f1e5c0010f1aad5529ae6a3964593c29e94cf8e Mon Sep 17 00:00:00 2001 From: Om Gate Date: Fri, 31 Jan 2025 15:43:14 +0530 Subject: [PATCH 04/12] refactor --- backend/director/agents/sales_assistant.py | 24 ---------------------- 1 file changed, 24 deletions(-) diff --git a/backend/director/agents/sales_assistant.py b/backend/director/agents/sales_assistant.py index c96b527f..f4e9e0b0 100644 --- a/backend/director/agents/sales_assistant.py +++ b/backend/director/agents/sales_assistant.py @@ -87,32 +87,8 @@ Mention when they need the product, when they want to test the product etc. Important details about the timelines must be added here. """ -DUMMY_TRANSCRIPT = """ -[Sales Rep]: Hi John, thanks for taking the time today. I understand you're looking for a new CRM solution for Becket and Stones. -[Client]: Yeah, our team is expanding, and we need something scalable. We want a system that integrates well with Salesforce. - -[Sales Rep]: That makes sense. Do you have a budget range in mind? - -[Client]: We're looking at something around **$12,500 to $17,500** annually. - -[Sales Rep]: Got it. Who will be making the final decision on this? - -[Client]: That would be me. I'm the **VP of Sales**, so I make the final call. - -[Sales Rep]: Great! Would you say this need is critical or just a nice-to-have? - -[Client]: It's **important**, but we could operate without it for now. - -[Sales Rep]: Understood. What's your timeline for making a decision? - -[Client]: We're planning for the **next quarter**. - -[Sales Rep]: Perfect! I'll schedule a presentation for next week to go over our solution in more detail. - -[Client]: Sounds good! -""" class SalesAssistantAgent(BaseAgent): def __init__(self, session: Session, **kwargs): self.agent_name = "sales_assistant" From d29de22c00f74459195370c4036836281423794f Mon Sep 17 00:00:00 2001 From: Om Gate Date: Mon, 3 Feb 2025 13:24:03 +0530 Subject: [PATCH 05/12] refactor --- backend/director/agents/sales_assistant.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/backend/director/agents/sales_assistant.py b/backend/director/agents/sales_assistant.py index f4e9e0b0..eddb0e50 100644 --- a/backend/director/agents/sales_assistant.py +++ b/backend/director/agents/sales_assistant.py @@ -51,7 +51,6 @@ Field: dealname description: (The company or individuals name with whom we are making a deal with) type: text (which says the name of person we are dealing with or the company) - default: Deal with John Doe Field: dealstage Possible Answers: appointmentscheduled, qualifiedtobuy, presentationscheduled, decisionmakerboughtin, contractsent, closedwon, closedlost @@ -210,8 +209,8 @@ def run(self, f"{json.dumps(composio_response)}" "If there are any errors or if it was not successful, do tell about that as well" ) - composio_response = ContextMessage(content=llm_prompt, role=RoleTypes.user) - llm_response = self.llm.chat_completions([composio_response.to_llm_msg()]) + final_message = ContextMessage(content=llm_prompt, role=RoleTypes.user) + llm_response = self.llm.chat_completions([final_message.to_llm_msg()]) if llm_response.status == LLMResponseStatus.ERROR: raise Exception(f"LLM Failed with error {llm_response.content}") From e183ac88997b2ebc954f95655f0fdd0219031c07 Mon Sep 17 00:00:00 2001 From: Om Gate Date: Tue, 4 Feb 2025 11:05:31 +0530 Subject: [PATCH 06/12] feat: status messages --- backend/director/agents/sales_assistant.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/backend/director/agents/sales_assistant.py b/backend/director/agents/sales_assistant.py index eddb0e50..d41e696b 100644 --- a/backend/director/agents/sales_assistant.py +++ b/backend/director/agents/sales_assistant.py @@ -140,9 +140,12 @@ def run(self, text_content = TextContent( agent_name=self.agent_name, status=MsgStatus.progress, - status_message="Making magic happen with VideoDB Director..", + status_message="Making magic happen with VideoDB Director...", ) + self.output_message.content.append(text_content) + self.output_message.push_update() + videodb_tool = VideoDBTool(collection_id=collection_id) self.output_message.actions.append("Extracting the transcript") @@ -203,9 +206,9 @@ def run(self, llm_prompt = ( f"User has asked to run a task: {composio_prompt} in Composio. \n" - "Format the following reponse into text.\n" - "Give the output which can be directly send to use \n" - "Don't add any extra text \n" + "Dont mention the action name directly as is" + "Comment on the fact whether the composio call was sucessful or not" + "Make this message short and crisp" f"{json.dumps(composio_response)}" "If there are any errors or if it was not successful, do tell about that as well" ) @@ -217,7 +220,7 @@ def run(self, text_content.text = llm_response.content text_content.status = MsgStatus.success text_content.status_message = "Here is the response from Composio" - + self.output_message.publish() except Exception as e: logger.exception(f"Error in {self.agent_name}") text_content.status = MsgStatus.error From 2c3dee5fb145d11a08b49bd27895c1ae1bf30a51 Mon Sep 17 00:00:00 2001 From: Om Gate Date: Wed, 5 Feb 2025 16:16:42 +0530 Subject: [PATCH 07/12] refactor --- backend/director/agents/sales_assistant.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/backend/director/agents/sales_assistant.py b/backend/director/agents/sales_assistant.py index d41e696b..0459e900 100644 --- a/backend/director/agents/sales_assistant.py +++ b/backend/director/agents/sales_assistant.py @@ -160,9 +160,6 @@ def run(self, videodb_tool.index_spoken_words(video_id) transcript_text = videodb_tool.get_transcript(video_id) - - # transcript_text = DUMMY_TRANSCRIPT - self.output_message.actions.append("Processing the transcript") self.output_message.push_update() From c00d55fbab1b1e35448679ca8653909487e79bdf Mon Sep 17 00:00:00 2001 From: Om Gate Date: Thu, 6 Feb 2025 11:07:44 +0530 Subject: [PATCH 08/12] feat: data for review --- backend/director/agents/sales_assistant.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/director/agents/sales_assistant.py b/backend/director/agents/sales_assistant.py index 0459e900..e7d2f30b 100644 --- a/backend/director/agents/sales_assistant.py +++ b/backend/director/agents/sales_assistant.py @@ -208,6 +208,7 @@ def run(self, "Make this message short and crisp" f"{json.dumps(composio_response)}" "If there are any errors or if it was not successful, do tell about that as well" + "If the response is successful, Show the details given to create a new deal in a markdown table format" ) final_message = ContextMessage(content=llm_prompt, role=RoleTypes.user) llm_response = self.llm.chat_completions([final_message.to_llm_msg()]) @@ -228,5 +229,5 @@ def run(self, return AgentResponse( status=AgentStatus.SUCCESS, message=f"Agent {self.name} completed successfully.", - data={}, + data={final_message: llm_response.content}, ) From a084295a469450f201b1d921e71652ade88a2e6b Mon Sep 17 00:00:00 2001 From: Om Gate Date: Thu, 6 Feb 2025 12:27:25 +0530 Subject: [PATCH 09/12] refactor --- backend/director/agents/sales_assistant.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/director/agents/sales_assistant.py b/backend/director/agents/sales_assistant.py index e7d2f30b..3958cca1 100644 --- a/backend/director/agents/sales_assistant.py +++ b/backend/director/agents/sales_assistant.py @@ -217,7 +217,7 @@ def run(self, text_content.text = llm_response.content text_content.status = MsgStatus.success - text_content.status_message = "Here is the response from Composio" + text_content.status_message = "Here is the result:" self.output_message.publish() except Exception as e: logger.exception(f"Error in {self.agent_name}") From d1a09c8a0681a7a2e335a81a453a76e8027dca62 Mon Sep 17 00:00:00 2001 From: Om Gate Date: Thu, 6 Feb 2025 12:44:36 +0530 Subject: [PATCH 10/12] refactor --- backend/director/agents/sales_assistant.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/backend/director/agents/sales_assistant.py b/backend/director/agents/sales_assistant.py index 3958cca1..881669e1 100644 --- a/backend/director/agents/sales_assistant.py +++ b/backend/director/agents/sales_assistant.py @@ -85,6 +85,11 @@ The multi line text answer for this field must consist of a detailed analysis of how the timeline of the project looks like Mention when they need the product, when they want to test the product etc. Important details about the timelines must be added here. + Since this is a BANT analysis. Do not forget to generate a response for these properties. + ALL THE ABOVE FIELDS ARE MANDATORY TO BE GENERATED AN OUTPUT FOR. + AN ANALYSIS FOR budget, authority, need and timeline IS COMPULSORY + + Only give answers to the field. Do not give any additional texts such as introduction, conclusion etc. """ @@ -229,5 +234,5 @@ def run(self, return AgentResponse( status=AgentStatus.SUCCESS, message=f"Agent {self.name} completed successfully.", - data={final_message: llm_response.content}, + data={}, ) From f4f67b8e359657d649b375dbd1557dc482bdb77e Mon Sep 17 00:00:00 2001 From: Om Gate Date: Thu, 6 Feb 2025 13:04:39 +0530 Subject: [PATCH 11/12] feat: description --- backend/director/agents/sales_assistant.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/director/agents/sales_assistant.py b/backend/director/agents/sales_assistant.py index 881669e1..a529d65e 100644 --- a/backend/director/agents/sales_assistant.py +++ b/backend/director/agents/sales_assistant.py @@ -96,7 +96,7 @@ class SalesAssistantAgent(BaseAgent): def __init__(self, session: Session, **kwargs): self.agent_name = "sales_assistant" - self.description = "This agent will transcribe sales calls, automatically create deal summaries & update CRM software like Salesforce & Hubspot" + self.description = "This agent will transcribe, study and analyse sales calls, automatically create deal summaries & update CRM software like Salesforce & Hubspot" self.parameters = SALES_ASSISTANT_PARAMETER self.llm = get_default_llm() super().__init__(session=session, **kwargs) From 27f4b85013a0227bb69671b74a3f131109a1060f Mon Sep 17 00:00:00 2001 From: Om Gate Date: Thu, 6 Feb 2025 13:27:18 +0530 Subject: [PATCH 12/12] eat: status message of text content --- backend/director/agents/sales_assistant.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/director/agents/sales_assistant.py b/backend/director/agents/sales_assistant.py index a529d65e..3fb442da 100644 --- a/backend/director/agents/sales_assistant.py +++ b/backend/director/agents/sales_assistant.py @@ -222,7 +222,7 @@ def run(self, text_content.text = llm_response.content text_content.status = MsgStatus.success - text_content.status_message = "Here is the result:" + text_content.status_message = "Here's the response from your sales assistant" self.output_message.publish() except Exception as e: logger.exception(f"Error in {self.agent_name}")