forked from filip-michalsky/SalesGPT
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aa9e177
commit e2ae203
Showing
12 changed files
with
208 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Updates to the SalesGPT project: Building the world's best AI Sales Agents. | ||
|
||
|
||
July 14, 2023 | ||
------------- | ||
|
||
Version 0.0.4 | ||
- Added tools to SalesGPT, creating a true agent. | ||
- Added product knowledge base as an example tool | ||
|
||
------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
from langchain.agents.agent import AgentOutputParser | ||
from langchain.schema import AgentAction, AgentFinish #OutputParserException | ||
from langchain.agents.conversational.prompt import FORMAT_INSTRUCTIONS | ||
import re | ||
from typing import Union | ||
|
||
|
||
class SalesConvoOutputParser(AgentOutputParser): | ||
ai_prefix: str = "AI" # change for salesperson_name | ||
verbose: bool = False | ||
|
||
def get_format_instructions(self) -> str: | ||
return FORMAT_INSTRUCTIONS | ||
|
||
def parse(self, text: str) -> Union[AgentAction, AgentFinish]: | ||
if self.verbose: | ||
print('TEXT') | ||
print(text) | ||
print('-------') | ||
if f"{self.ai_prefix}:" in text: | ||
return AgentFinish( | ||
{"output": text.split(f"{self.ai_prefix}:")[-1].strip()}, text | ||
) | ||
regex = r"Action: (.*?)[\n]*Action Input: (.*)" | ||
match = re.search(regex, text) | ||
if not match: | ||
## TODO - this is not entirely reliable, sometimes results in an error. | ||
return AgentFinish( | ||
{"output": "I apologize, I was unable to find the answer to your question. Is there anything else I can help with?"}, text | ||
) | ||
# raise OutputParserException(f"Could not parse LLM output: `{text}`") | ||
action = match.group(1) | ||
action_input = match.group(2) | ||
return AgentAction(action.strip(), action_input.strip(" ").strip('"'), text) | ||
|
||
@property | ||
def _type(self) -> str: | ||
return "sales-agent" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
|
||
SALES_AGENT_TOOLS_PROMPT =""" | ||
Never forget your name is {salesperson_name}. You work as a {salesperson_role}. | ||
You work at company named {company_name}. {company_name}'s business is the following: {company_business}. | ||
Company values are the following. {company_values} | ||
You are contacting a potential prospect in order to {conversation_purpose} | ||
Your means of contacting the prospect is {conversation_type} | ||
If you're asked about where you got the user's contact information, say that you got it from public records. | ||
Keep your responses in short length to retain the user's attention. Never produce lists, just answers. | ||
Start the conversation by just a greeting and how is the prospect doing without pitching in your first turn. | ||
When the conversation is over, output <END_OF_CALL> | ||
Always think about at which conversation stage you are at before answering: | ||
1: Introduction: Start the conversation by introducing yourself and your company. Be polite and respectful while keeping the tone of the conversation professional. Your greeting should be welcoming. Always clarify in your greeting the reason why you are calling. | ||
2: Qualification: Qualify the prospect by confirming if they are the right person to talk to regarding your product/service. Ensure that they have the authority to make purchasing decisions. | ||
3: Value proposition: Briefly explain how your product/service can benefit the prospect. Focus on the unique selling points and value proposition of your product/service that sets it apart from competitors. | ||
4: Needs analysis: Ask open-ended questions to uncover the prospect's needs and pain points. Listen carefully to their responses and take notes. | ||
5: Solution presentation: Based on the prospect's needs, present your product/service as the solution that can address their pain points. | ||
6: Objection handling: Address any objections that the prospect may have regarding your product/service. Be prepared to provide evidence or testimonials to support your claims. | ||
7: Close: Ask for the sale by proposing a next step. This could be a demo, a trial or a meeting with decision-makers. Ensure to summarize what has been discussed and reiterate the benefits. | ||
8: End conversation: The prospect has to leave to call, the prospect is not interested, or next steps where already determined by the sales agent. | ||
TOOLS: | ||
------ | ||
{salesperson_name} has access to the following tools: | ||
{tools} | ||
To use a tool, please use the following format: | ||
``` | ||
Thought: Do I need to use a tool? Yes | ||
Action: the action to take, should be one of {tools} | ||
Action Input: the input to the action, always a simple string input | ||
Observation: the result of the action | ||
``` | ||
If the result of the action is "I don't know." or "Sorry I don't know", then you have to say that to the user as described in the next sentence. | ||
When you have a response to say to the Human, or if you do not need to use a tool, or if tool did not help, you MUST use the format: | ||
``` | ||
Thought: Do I need to use a tool? No | ||
{salesperson_name}: [your response here, if previously used a tool, rephrase latest observation, if unable to find the answer, say it] | ||
``` | ||
You must respond according to the previous conversation history and the stage of the conversation you are at. | ||
Only generate one response at a time and act as {salesperson_name} only! | ||
Begin! | ||
Previous conversation history: | ||
{conversation_history} | ||
{salesperson_name}: | ||
{agent_scratchpad} | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
"""Version information.""" | ||
|
||
__version__ = "0.0.3" | ||
__version__ = "0.0.4" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
Sleep Haven Products | ||
|
||
Luxury Cloud-Comfort Memory Foam Mattress | ||
Experience the epitome of opulence with our Luxury Cloud-Comfort Memory Foam Mattress. Designed with an innovative, temperature-sensitive memory foam layer, this mattress embraces your body shape, offering personalized support and unparalleled comfort. The mattress is completed with a high-density foam base that ensures longevity, maintaining its form and resilience for years. With the incorporation of cooling gel-infused particles, it regulates your body temperature throughout the night, providing a perfect cool slumbering environment. The breathable, hypoallergenic cover, exquisitely embroidered with silver threads, not only adds a touch of elegance to your bedroom but also keeps allergens at bay. For a restful night and a refreshed morning, invest in the Luxury Cloud-Comfort Memory Foam Mattress. | ||
Price: $999 | ||
Sizes available: Twin, Queen, King | ||
|
||
Classic Harmony Spring Mattress | ||
A perfect blend of traditional craftsmanship and modern comfort, the Classic Harmony Spring Mattress is designed to give you restful, uninterrupted sleep. It features a robust inner spring construction, complemented by layers of plush padding that offers the perfect balance of support and comfort. The quilted top layer is soft to the touch, adding an extra level of luxury to your sleeping experience. Reinforced edges prevent sagging, ensuring durability and a consistent sleeping surface, while the natural cotton cover wicks away moisture, keeping you dry and comfortable throughout the night. The Classic Harmony Spring Mattress is a timeless choice for those who appreciate the perfect fusion of support and plush comfort. | ||
Price: $1,299 | ||
Sizes available: Queen, King | ||
|
||
EcoGreen Hybrid Latex Mattress | ||
The EcoGreen Hybrid Latex Mattress is a testament to sustainable luxury. Made from 100% natural latex harvested from eco-friendly plantations, this mattress offers a responsive, bouncy feel combined with the benefits of pressure relief. It is layered over a core of individually pocketed coils, ensuring minimal motion transfer, perfect for those sharing their bed. The mattress is wrapped in a certified organic cotton cover, offering a soft, breathable surface that enhances your comfort. Furthermore, the natural antimicrobial and hypoallergenic properties of latex make this mattress a great choice for allergy sufferers. Embrace a green lifestyle without compromising on comfort with the EcoGreen Hybrid Latex Mattress. | ||
Price: $1,599 | ||
Sizes available: Twin, Full | ||
|
||
Plush Serenity Bamboo Mattress | ||
The Plush Serenity Bamboo Mattress takes the concept of sleep to new heights of comfort and environmental responsibility. The mattress features a layer of plush, adaptive foam that molds to your body's unique shape, providing tailored support for each sleeper. Underneath, a base of high-resilience support foam adds longevity and prevents sagging. The crowning glory of this mattress is its bamboo-infused top layer - this sustainable material is not only gentle on the planet, but also creates a remarkably soft, cool sleeping surface. Bamboo's natural breathability and moisture-wicking properties make it excellent for temperature regulation, helping to keep you cool and dry all night long. Encased in a silky, removable bamboo cover that's easy to clean and maintain, the Plush Serenity Bamboo Mattress offers a luxurious and eco-friendly sleeping experience. | ||
Price: $2,599 | ||
Sizes_ vailable: King |
Oops, something went wrong.