diff --git a/.env.example b/.env.example index c76bdef4..0e714680 100644 --- a/.env.example +++ b/.env.example @@ -11,7 +11,6 @@ CONFIG_PATH=examples/example_agent_setup.json PRODUCT_CATALOG=examples/sample_product_catalog.txt PRODUCT_PRICE_MAPPING=examples/example_product_price_id_mapping.json - #Gmail API config for sending emails GMAIL_APP_PASSWORD=xx GMAIL_MAIL=yy @@ -24,3 +23,6 @@ PAYMENT_GATEWAY_URL=https://agent-payments-gateway.vercel.app/payment CALENDLY_API_KEY=xx CALENDLY_EVENT_UUID=yy +#Enable local api startup +ENVIRONMENT=development + diff --git a/.gitignore b/.gitignore index 1be48ff0..be4e6017 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ examples/sales_agent_bedrock.ipynb **__pycache__ /scratch **.chroma/ +.env.filip # Distribution / packaging diff --git a/CHANGELOG.txt b/CHANGELOG.txt index eaf387b4..9989b9c5 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,5 +1,11 @@ Updates to the SalesGPT project: Building the world's best AI Sales Agents and virtual workers. +May 8, 2024 +--------------- +Version 0.1.3 +- SalesGPT has analytics tracking built into documentation for improved understanding of important features and update necessities +- Added option for local frontend startup with ENVIRONMENT variable + March 22, 2024 --------------- Version 0.1.2 diff --git a/api-website/_build/doctrees/environment.pickle b/api-website/_build/doctrees/environment.pickle index 6976cd9b..31b7c764 100644 Binary files a/api-website/_build/doctrees/environment.pickle and b/api-website/_build/doctrees/environment.pickle differ diff --git a/api-website/_build/doctrees/googleanalytics/README.doctree b/api-website/_build/doctrees/googleanalytics/README.doctree new file mode 100644 index 00000000..b58da384 Binary files /dev/null and b/api-website/_build/doctrees/googleanalytics/README.doctree differ diff --git a/api-website/_build/doctrees/index.doctree b/api-website/_build/doctrees/index.doctree index 975d4153..0d29ca4e 100644 Binary files a/api-website/_build/doctrees/index.doctree and b/api-website/_build/doctrees/index.doctree differ diff --git a/api-website/_build/doctrees/salesgpt/modules.doctree b/api-website/_build/doctrees/salesgpt/modules.doctree index 3d493c00..114a1bb4 100644 Binary files a/api-website/_build/doctrees/salesgpt/modules.doctree and b/api-website/_build/doctrees/salesgpt/modules.doctree differ diff --git a/api-website/_build/doctrees/salesgpt/salesgpt.agents.doctree b/api-website/_build/doctrees/salesgpt/salesgpt.agents.doctree index af03d007..71b1db1e 100644 Binary files a/api-website/_build/doctrees/salesgpt/salesgpt.agents.doctree and b/api-website/_build/doctrees/salesgpt/salesgpt.agents.doctree differ diff --git a/api-website/_build/doctrees/salesgpt/salesgpt.chains.doctree b/api-website/_build/doctrees/salesgpt/salesgpt.chains.doctree index 0f668428..f374483c 100644 Binary files a/api-website/_build/doctrees/salesgpt/salesgpt.chains.doctree and b/api-website/_build/doctrees/salesgpt/salesgpt.chains.doctree differ diff --git a/api-website/_build/doctrees/salesgpt/salesgpt.doctree b/api-website/_build/doctrees/salesgpt/salesgpt.doctree index ae74504e..15005d9b 100644 Binary files a/api-website/_build/doctrees/salesgpt/salesgpt.doctree and b/api-website/_build/doctrees/salesgpt/salesgpt.doctree differ diff --git a/api-website/_build/doctrees/salesgpt/salesgpt.logger.doctree b/api-website/_build/doctrees/salesgpt/salesgpt.logger.doctree index 152706c9..e60e3657 100644 Binary files a/api-website/_build/doctrees/salesgpt/salesgpt.logger.doctree and b/api-website/_build/doctrees/salesgpt/salesgpt.logger.doctree differ diff --git a/api-website/_build/doctrees/salesgpt/salesgpt.parsers.doctree b/api-website/_build/doctrees/salesgpt/salesgpt.parsers.doctree index f1162b09..1f3e8fd2 100644 Binary files a/api-website/_build/doctrees/salesgpt/salesgpt.parsers.doctree and b/api-website/_build/doctrees/salesgpt/salesgpt.parsers.doctree differ diff --git a/api-website/_build/doctrees/salesgpt/salesgpt.prompts.doctree b/api-website/_build/doctrees/salesgpt/salesgpt.prompts.doctree index 5d54dcf7..cc012b85 100644 Binary files a/api-website/_build/doctrees/salesgpt/salesgpt.prompts.doctree and b/api-website/_build/doctrees/salesgpt/salesgpt.prompts.doctree differ diff --git a/api-website/_build/doctrees/salesgpt/salesgpt.prompts_cn.doctree b/api-website/_build/doctrees/salesgpt/salesgpt.prompts_cn.doctree index ea6ae34e..6c0df954 100644 Binary files a/api-website/_build/doctrees/salesgpt/salesgpt.prompts_cn.doctree and b/api-website/_build/doctrees/salesgpt/salesgpt.prompts_cn.doctree differ diff --git a/api-website/_build/doctrees/salesgpt/salesgpt.salesgptapi.doctree b/api-website/_build/doctrees/salesgpt/salesgpt.salesgptapi.doctree index 99b7f9ae..fbeddcdf 100644 Binary files a/api-website/_build/doctrees/salesgpt/salesgpt.salesgptapi.doctree and b/api-website/_build/doctrees/salesgpt/salesgpt.salesgptapi.doctree differ diff --git a/api-website/_build/doctrees/salesgpt/salesgpt.stages.doctree b/api-website/_build/doctrees/salesgpt/salesgpt.stages.doctree index dd19af2e..79a9d43f 100644 Binary files a/api-website/_build/doctrees/salesgpt/salesgpt.stages.doctree and b/api-website/_build/doctrees/salesgpt/salesgpt.stages.doctree differ diff --git a/api-website/_build/doctrees/salesgpt/salesgpt.templates.doctree b/api-website/_build/doctrees/salesgpt/salesgpt.templates.doctree index a04e379a..e49ce2b7 100644 Binary files a/api-website/_build/doctrees/salesgpt/salesgpt.templates.doctree and b/api-website/_build/doctrees/salesgpt/salesgpt.templates.doctree differ diff --git a/api-website/_build/doctrees/salesgpt/salesgpt.tools.doctree b/api-website/_build/doctrees/salesgpt/salesgpt.tools.doctree index 6ce3a0ca..5d3e6b45 100644 Binary files a/api-website/_build/doctrees/salesgpt/salesgpt.tools.doctree and b/api-website/_build/doctrees/salesgpt/salesgpt.tools.doctree differ diff --git a/api-website/_build/doctrees/salesgpt/salesgpt.version.doctree b/api-website/_build/doctrees/salesgpt/salesgpt.version.doctree index 4cfd9bdb..3e2dc2e0 100644 Binary files a/api-website/_build/doctrees/salesgpt/salesgpt.version.doctree and b/api-website/_build/doctrees/salesgpt/salesgpt.version.doctree differ diff --git a/api-website/_build/html/.buildinfo b/api-website/_build/html/.buildinfo index 0074918b..0dfbdaf1 100644 --- a/api-website/_build/html/.buildinfo +++ b/api-website/_build/html/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: e5df60454524fb28d5e2b3c23043e531 +config: c5bf57642e839bbe8412743aae371109 tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/api-website/_build/html/_sources/googleanalytics/README.rst.txt b/api-website/_build/html/_sources/googleanalytics/README.rst.txt new file mode 100644 index 00000000..5a725c27 --- /dev/null +++ b/api-website/_build/html/_sources/googleanalytics/README.rst.txt @@ -0,0 +1,59 @@ +.. -*- restructuredtext -*- + +=========================================== +Google Analytics extension for Sphinx +=========================================== + +:author: Domen Kožar + + +About +===== + +This extensions allows you to track generated html files +with Google Analytics web service. + + +Installing from sphinx-contrib checkout +--------------------------------------- + +Checkout googleanalytics sphinx extension:: + + $ git clone https://github.com/sphinx-contrib/googleanalytics + +Change into the googleanalytics directory:: + + $ cd googleanalytics + +Install the module:: + + $ python setup.py install + + +Enabling the extension in Sphinx_ +--------------------------------- + +Just add ``sphinxcontrib.googleanalytics`` to the list of extensions in the ``conf.py`` +file. For example:: + + extensions = ['sphinxcontrib.googleanalytics'] + + +Configuration +------------- + +For now one optional configuration is added to Sphinx_. It can be set in +``conf.py`` file: + +``googleanalytics_id`` : + UA id for your site, example:: + googleanalytics_id = 'UA-123-123-123' + +``googleanalytics_enabled`` : + True by default, use it to turn off tracking. + + +.. Links: +.. _gnuplot: http://www.gnuplot.info/ +.. _Sphinx: http://sphinx.pocoo.org/ + diff --git a/api-website/_build/html/_static/google_analytics_tracker.js b/api-website/_build/html/_static/google_analytics_tracker.js new file mode 100644 index 00000000..11381ec4 --- /dev/null +++ b/api-website/_build/html/_static/google_analytics_tracker.js @@ -0,0 +1,4 @@ +window.dataLayer = window.dataLayer || []; +function gtag(){dataLayer.push(arguments);} +gtag('js', new Date()); +gtag('config', 'GTM-NX3SZD79'); \ No newline at end of file diff --git a/api-website/_build/html/_static/pygments.css b/api-website/_build/html/_static/pygments.css index 08bec689..84ab3030 100644 --- a/api-website/_build/html/_static/pygments.css +++ b/api-website/_build/html/_static/pygments.css @@ -17,6 +17,7 @@ span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: .highlight .cs { color: #3D7B7B; font-style: italic } /* Comment.Special */ .highlight .gd { color: #A00000 } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ +.highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */ .highlight .gr { color: #E40000 } /* Generic.Error */ .highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ .highlight .gi { color: #008400 } /* Generic.Inserted */ diff --git a/api-website/_build/html/genindex.html b/api-website/_build/html/genindex.html index 88d4e924..43e9e741 100644 --- a/api-website/_build/html/genindex.html +++ b/api-website/_build/html/genindex.html @@ -2,9 +2,28 @@ + + + + + + + Index — SalesGPT documentation - + @@ -18,6 +37,17 @@ + + + + + @@ -114,6 +144,8 @@

A

@@ -184,10 +220,18 @@

F

G

@@ -203,6 +247,10 @@

H

I

+
  • input_keys (salesgpt.agents.SalesGPT property)
  • @@ -384,6 +432,10 @@

    S

  • salesperson_role (salesgpt.agents.SalesGPT attribute)
  • seed_agent() (salesgpt.agents.SalesGPT method) +
  • +
  • send_email_tool() (in module salesgpt.tools) +
  • +
  • send_email_with_gmail() (in module salesgpt.tools)
  • setup_knowledge_base() (in module salesgpt.tools)
  • @@ -416,10 +468,6 @@

    U

    -
    diff --git a/api-website/_build/html/googleanalytics/README.html b/api-website/_build/html/googleanalytics/README.html new file mode 100644 index 00000000..b986d993 --- /dev/null +++ b/api-website/_build/html/googleanalytics/README.html @@ -0,0 +1,200 @@ + + + + + + + + + + + + + + Google Analytics extension for Sphinx — SalesGPT documentation + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    Google Analytics extension for Sphinx

    +
    +
    author:
    +

    Domen Kožar <domen@dev.si>

    +
    +
    +
    +

    About

    +

    This extensions allows you to track generated html files +with Google Analytics web service.

    +
    +

    Installing from sphinx-contrib checkout

    +

    Checkout googleanalytics sphinx extension:

    +
    $ git clone https://github.com/sphinx-contrib/googleanalytics
    +
    +
    +

    Change into the googleanalytics directory:

    +
    $ cd googleanalytics
    +
    +
    +

    Install the module:

    +
    $ python setup.py install
    +
    +
    +
    +
    +

    Enabling the extension in Sphinx

    +

    Just add sphinxcontrib.googleanalytics to the list of extensions in the conf.py +file. For example:

    +
    extensions = ['sphinxcontrib.googleanalytics']
    +
    +
    +
    +
    +

    Configuration

    +

    For now one optional configuration is added to Sphinx. It can be set in +conf.py file:

    +
    +
    googleanalytics_id <string>:
    +
    UA id for your site, example::

    googleanalytics_id = ‘UA-123-123-123’

    +
    +
    +
    +
    googleanalytics_enabled <bool>:

    True by default, use it to turn off tracking.

    +
    +
    +
    +
    +
    + + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Filip-Michalsky.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    + + + +
    +
    + + + + \ No newline at end of file diff --git a/api-website/_build/html/index.html b/api-website/_build/html/index.html index d31ab981..2e117d64 100644 --- a/api-website/_build/html/index.html +++ b/api-website/_build/html/index.html @@ -1,11 +1,30 @@ - - + + + + + + + + + Welcome to SalesGPT’s documentation! — SalesGPT documentation - + @@ -19,6 +38,17 @@ + + + + + @@ -121,7 +151,14 @@

    Welcome to SalesGPT’s documentation!Tools diff --git a/api-website/_build/html/layout.html b/api-website/_build/html/layout.html new file mode 100644 index 00000000..6e7464f2 --- /dev/null +++ b/api-website/_build/html/layout.html @@ -0,0 +1,146 @@ + + + + + + + + + + + + + — SalesGPT documentation + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    +
      +
    • + +
    • +
    • +
    +
    +
    +
    +
    + +
    +
    +
    + +
    + +
    +

    © Copyright 2024, Filip-Michalsky.

    +
    + + Built with Sphinx using a + theme + provided by Read the Docs. + + +
    +
    +
    + + + +
    +
    + + + + \ No newline at end of file diff --git a/api-website/_build/html/objects.inv b/api-website/_build/html/objects.inv index a4dcd25e..3cc4c344 100644 Binary files a/api-website/_build/html/objects.inv and b/api-website/_build/html/objects.inv differ diff --git a/api-website/_build/html/py-modindex.html b/api-website/_build/html/py-modindex.html index 538012f2..b9eb2efa 100644 --- a/api-website/_build/html/py-modindex.html +++ b/api-website/_build/html/py-modindex.html @@ -2,9 +2,28 @@ + + + + + + + Python Module Index — SalesGPT documentation - + @@ -18,6 +37,17 @@ + + + + + diff --git a/api-website/_build/html/salesgpt/modules.html b/api-website/_build/html/salesgpt/modules.html index ecd8e0ec..333a9141 100644 --- a/api-website/_build/html/salesgpt/modules.html +++ b/api-website/_build/html/salesgpt/modules.html @@ -1,11 +1,30 @@ - - + + + + + + + + + salesgpt — SalesGPT documentation - + @@ -19,6 +38,17 @@ + + + + + @@ -121,7 +151,14 @@

    salesgpt

  • salesgpt.tools module
  • diff --git a/api-website/_build/html/salesgpt/salesgpt.agents.html b/api-website/_build/html/salesgpt/salesgpt.agents.html index f94548da..a00d79f2 100644 --- a/api-website/_build/html/salesgpt/salesgpt.agents.html +++ b/api-website/_build/html/salesgpt/salesgpt.agents.html @@ -1,11 +1,30 @@ - - + + + + + + + + + salesgpt.agents module — SalesGPT documentation - + @@ -19,6 +38,17 @@ + + + + + @@ -54,6 +84,7 @@
  • SalesGPT
    • SalesGPT.acall()
    • SalesGPT.acompletion_with_retry()
    • +
    • SalesGPT.adetermine_conversation_stage()
    • SalesGPT.astep()
    • SalesGPT.company_business
    • SalesGPT.company_name
    • @@ -124,26 +155,27 @@

      salesgpt.agents module

      -class salesgpt.agents.SalesGPT(*, name: str | None = None, memory: BaseMemory | None = None, callbacks: List[BaseCallbackHandler] | BaseCallbackManager | None = None, verbose: bool = None, tags: List[str] | None = None, metadata: Dict[str, Any] | None = None, callback_manager: BaseCallbackManager | None = None, conversation_history: List[str] = [], conversation_stage_id: str = '1', current_conversation_stage: str = '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.', stage_analyzer_chain: StageAnalyzerChain = FieldInfo(default=Ellipsis, extra={}), sales_agent_executor: AgentExecutor | None = FieldInfo(default=Ellipsis, extra={}), knowledge_base: RetrievalQA | None = FieldInfo(default=Ellipsis, extra={}), sales_conversation_utterance_chain: SalesConversationChain = FieldInfo(default=Ellipsis, extra={}), conversation_stage_dict: Dict = {'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: It's time to end the call as there is nothing else to be said."}, model_name: str = 'gpt-3.5-turbo-0613', use_tools: bool = False, salesperson_name: str = 'Ted Lasso', salesperson_role: str = 'Business Development Representative', company_name: str = 'Sleep Haven', company_business: str = 'Sleep Haven is a premium mattress company that provides customers with the most comfortable and supportive sleeping experience possible. We offer a range of high-quality mattresses, pillows, and bedding accessories that are designed to meet the unique needs of our customers.', company_values: str = "Our mission at Sleep Haven is to help people achieve a better night's sleep by providing them with the best possible sleep solutions. We believe that quality sleep is essential to overall health and well-being, and we are committed to helping our customers achieve optimal sleep by offering exceptional products and customer service.", conversation_purpose: str = 'find out whether they are looking to achieve better sleep via buying a premier mattress.', conversation_type: str = 'call')
      +class salesgpt.agents.SalesGPT(*, name: str | None = None, memory: BaseMemory | None = None, callbacks: List[BaseCallbackHandler] | BaseCallbackManager | None = None, verbose: bool = None, tags: List[str] | None = None, metadata: Dict[str, Any] | None = None, callback_manager: BaseCallbackManager | None = None, conversation_history: List[str] = [], conversation_stage_id: str = '1', current_conversation_stage: str = '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.', stage_analyzer_chain: StageAnalyzerChain = FieldInfo(annotation=NoneType, required=True), sales_agent_executor: CustomAgentExecutor | None = FieldInfo(annotation=NoneType, required=True), knowledge_base: RetrievalQA | None = FieldInfo(annotation=NoneType, required=True), sales_conversation_utterance_chain: SalesConversationChain = FieldInfo(annotation=NoneType, required=True), conversation_stage_dict: Dict = {'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: It's time to end the call as there is nothing else to be said."}, model_name: str = 'gpt-3.5-turbo-0613', use_tools: bool = False, salesperson_name: str = 'Ted Lasso', salesperson_role: str = 'Business Development Representative', company_name: str = 'Sleep Haven', company_business: str = 'Sleep Haven is a premium mattress company that provides customers with the most comfortable and supportive sleeping experience possible. We offer a range of high-quality mattresses, pillows, and bedding accessories that are designed to meet the unique needs of our customers.', company_values: str = "Our mission at Sleep Haven is to help people achieve a better night's sleep by providing them with the best possible sleep solutions. We believe that quality sleep is essential to overall health and well-being, and we are committed to helping our customers achieve optimal sleep by offering exceptional products and customer service.", conversation_purpose: str = 'find out whether they are looking to achieve better sleep via buying a premier mattress.', conversation_type: str = 'call')

      Bases: Chain

      Controller model for the Sales Agent.

      -acall(*args, **kwargs)
      -

      This method is currently not implemented.

      +acall(inputs: Dict[str, Any]) Dict[str, Any] +

      Executes one step of the sales agent.

      +

      This function overrides the input temporarily with the current state of the conversation, +generates the agent’s utterance using either the sales agent executor or the sales conversation utterance chain, +adds the agent’s response to the conversation history, and returns the AI message.

      Parameters

      -
      *argstuple

      Variable length argument list.

      -
      -
      **kwargsdict

      Arbitrary keyword arguments.

      +
      inputsDict[str, Any]

      The initial inputs for the sales agent.

      -
      -

      Raises

      +
      +

      Returns

      -
      NotImplementedError

      Indicates that this method has not been implemented yet.

      +
      Dict[str, Any]

      The AI message generated by the sales agent.

      @@ -154,7 +186,7 @@

      Raises< async acompletion_with_retry(llm: Any, **kwargs: Any) Any

      Use tenacity to retry the async completion call.

      This method uses the tenacity library to retry the asynchronous completion call in case of failure. -It creates a retry decorator using the ‘_create_retry_decorator’ method and applies it to the +It creates a retry decorator using the ‘_create_retry_decorator’ method and applies it to the ‘_completion_with_retry’ function which makes the actual asynchronous completion call.

      Parameters

      @@ -165,15 +197,15 @@

      Parameters

      -
      -

      Returns

      +
      +

      Returns

      Any

      The result of the completion function call.

      -
      -

      Raises

      +
      +

      Raises

      Exception

      If the completion function call fails after the maximum number of retries.

      @@ -181,6 +213,22 @@

      Raises

      +
      +
      +adetermine_conversation_stage()
      +

      Determines the current conversation stage based on the conversation history.

      +

      This method uses the stage_analyzer_chain to analyze the conversation history and determine the current stage. +The conversation history is joined into a single string, with each entry separated by a newline character. +The current conversation stage ID is also passed to the stage_analyzer_chain.

      +

      The method then prints the determined conversation stage ID and retrieves the corresponding conversation stage +from the conversation_stage_dict dictionary using the retrieve_conversation_stage method.

      +

      Finally, the method prints the determined conversation stage.

      +
      +
      Returns:

      None

      +
      +
      +
      +
      astep(stream: bool = False)
      @@ -188,7 +236,7 @@

      Raises

      If the stream argument is set to False, it calls the _acall method with an empty dictionary as input. If the stream argument is set to True, it returns a streaming generator object for manipulating streaming chunks in downstream applications.

      -
      Args:

      stream (bool, optional): A flag indicating whether to return a streaming generator object. +

      Args:

      stream (bool, optional): A flag indicating whether to return a streaming generator object. Defaults to False.

      Returns:

      Generator: A streaming generator object if stream is set to True. Otherwise, it returns None.

      @@ -289,7 +337,7 @@

      Returns human_step(human_input)

      Processes the human input and appends it to the conversation history.

      -

      This method takes the human input as a string, formats it by adding “User: ” at the beginning and ” <END_OF_TURN>” at the end, and then appends this formatted string to the conversation history.

      +

      This method takes the human input as a string, formats it by adding “User: “ at the beginning and “ <END_OF_TURN>” at the end, and then appends this formatted string to the conversation history.

      Args:

      human_input (str): The input string from the human user.

      @@ -348,7 +396,7 @@

      Returns
      -sales_agent_executor: AgentExecutor | None
      +sales_agent_executor: CustomAgentExecutor | None

      @@ -385,11 +433,11 @@

      Returns
      step(stream: bool = False)
      -

      Executes a step in the conversation. If the stream argument is set to True, -it returns a streaming generator object for manipulating streaming chunks in downstream applications. +

      Executes a step in the conversation. If the stream argument is set to True, +it returns a streaming generator object for manipulating streaming chunks in downstream applications. If the stream argument is set to False, it calls the _call method with an empty dictionary as input.

      -
      Args:

      stream (bool, optional): A flag indicating whether to return a streaming generator object. +

      Args:

      stream (bool, optional): A flag indicating whether to return a streaming generator object. Defaults to False.

      Returns:

      Generator: A streaming generator object if stream is set to True. Otherwise, it returns None.

      diff --git a/api-website/_build/html/salesgpt/salesgpt.chains.html b/api-website/_build/html/salesgpt/salesgpt.chains.html index e668ece2..7bd989fd 100644 --- a/api-website/_build/html/salesgpt/salesgpt.chains.html +++ b/api-website/_build/html/salesgpt/salesgpt.chains.html @@ -1,11 +1,30 @@ - - + + + + + + + + + salesgpt.chains module — SalesGPT documentation - + @@ -19,6 +38,17 @@ + + + + + @@ -101,7 +131,7 @@

      salesgpt.chains module

      -class salesgpt.chains.SalesConversationChain(*, name: str | None = None, memory: BaseMemory | None = None, callbacks: List[BaseCallbackHandler] | BaseCallbackManager | None = None, verbose: bool = None, tags: List[str] | None = None, metadata: Dict[str, Any] | None = None, callback_manager: BaseCallbackManager | None = None, prompt: BasePromptTemplate, llm: Runnable[PromptValue | str | Sequence[BaseMessage | Tuple[str, str] | str | Dict[str, Any]], str] | Runnable[PromptValue | str | Sequence[BaseMessage | Tuple[str, str] | str | Dict[str, Any]], BaseMessage], output_key: str = 'text', output_parser: BaseLLMOutputParser = None, return_final_only: bool = True, llm_kwargs: dict = None)
      +class salesgpt.chains.SalesConversationChain(*, name: str | None = None, memory: BaseMemory | None = None, callbacks: List[BaseCallbackHandler] | BaseCallbackManager | None = None, verbose: bool = None, tags: List[str] | None = None, metadata: Dict[str, Any] | None = None, callback_manager: BaseCallbackManager | None = None, prompt: BasePromptTemplate, llm: Runnable[PromptValue | str | Sequence[BaseMessage], str] | Runnable[PromptValue | str | Sequence[BaseMessage], BaseMessage], output_key: str = 'text', output_parser: BaseLLMOutputParser = None, return_final_only: bool = True, llm_kwargs: dict = None)

      Bases: LLMChain

      Chain to generate the next utterance for the conversation.

      @@ -114,7 +144,7 @@
      -class salesgpt.chains.StageAnalyzerChain(*, name: str | None = None, memory: BaseMemory | None = None, callbacks: List[BaseCallbackHandler] | BaseCallbackManager | None = None, verbose: bool = None, tags: List[str] | None = None, metadata: Dict[str, Any] | None = None, callback_manager: BaseCallbackManager | None = None, prompt: BasePromptTemplate, llm: Runnable[PromptValue | str | Sequence[BaseMessage | Tuple[str, str] | str | Dict[str, Any]], str] | Runnable[PromptValue | str | Sequence[BaseMessage | Tuple[str, str] | str | Dict[str, Any]], BaseMessage], output_key: str = 'text', output_parser: BaseLLMOutputParser = None, return_final_only: bool = True, llm_kwargs: dict = None)
      +class salesgpt.chains.StageAnalyzerChain(*, name: str | None = None, memory: BaseMemory | None = None, callbacks: List[BaseCallbackHandler] | BaseCallbackManager | None = None, verbose: bool = None, tags: List[str] | None = None, metadata: Dict[str, Any] | None = None, callback_manager: BaseCallbackManager | None = None, prompt: BasePromptTemplate, llm: Runnable[PromptValue | str | Sequence[BaseMessage], str] | Runnable[PromptValue | str | Sequence[BaseMessage], BaseMessage], output_key: str = 'text', output_parser: BaseLLMOutputParser = None, return_final_only: bool = True, llm_kwargs: dict = None)

      Bases: LLMChain

      Chain to analyze which conversation stage should the conversation move into.

      diff --git a/api-website/_build/html/salesgpt/salesgpt.html b/api-website/_build/html/salesgpt/salesgpt.html index bec63171..889a6799 100644 --- a/api-website/_build/html/salesgpt/salesgpt.html +++ b/api-website/_build/html/salesgpt/salesgpt.html @@ -1,11 +1,30 @@ - + + + + + + + + salesgpt package — SalesGPT documentation - + @@ -19,6 +38,17 @@ + + + + + @@ -96,6 +126,7 @@

      SubmodulesSalesGPT
      • SalesGPT.acall()
      • SalesGPT.acompletion_with_retry()
      • +
      • SalesGPT.adetermine_conversation_stage()
      • SalesGPT.astep()
      • SalesGPT.company_business
      • SalesGPT.company_name
      • @@ -159,8 +190,9 @@

        Submodulessalesgpt.prompts_cn module
      • salesgpt.salesgptapi module @@ -176,7 +208,14 @@

        Submodulessalesgpt.tools module

      • diff --git a/api-website/_build/html/salesgpt/salesgpt.logger.html b/api-website/_build/html/salesgpt/salesgpt.logger.html index 03e8665b..89382399 100644 --- a/api-website/_build/html/salesgpt/salesgpt.logger.html +++ b/api-website/_build/html/salesgpt/salesgpt.logger.html @@ -1,11 +1,30 @@ - - + + + + + + + + + salesgpt.logger module — SalesGPT documentation - + @@ -19,6 +38,17 @@ + + + + + @@ -114,8 +144,8 @@
        salesgpt.logger.time_logger(func)

        Decorator function to log the time taken by any function.

        -

        This decorator logs the execution time of the decorated function. It logs the start time before the function -execution, the end time after the function execution, and calculates the execution time. The function name and +

        This decorator logs the execution time of the decorated function. It logs the start time before the function +execution, the end time after the function execution, and calculates the execution time. The function name and execution time are then logged at the INFO level.

        Args:

        func (Callable): The function to be decorated.

        diff --git a/api-website/_build/html/salesgpt/salesgpt.parsers.html b/api-website/_build/html/salesgpt/salesgpt.parsers.html index af1bffd9..14b658f5 100644 --- a/api-website/_build/html/salesgpt/salesgpt.parsers.html +++ b/api-website/_build/html/salesgpt/salesgpt.parsers.html @@ -1,11 +1,30 @@ - - + + + + + + + + + salesgpt.parsers module — SalesGPT documentation - + @@ -19,6 +38,17 @@ + + + + + diff --git a/api-website/_build/html/salesgpt/salesgpt.prompts.html b/api-website/_build/html/salesgpt/salesgpt.prompts.html index 0ba991ea..79b9f850 100644 --- a/api-website/_build/html/salesgpt/salesgpt.prompts.html +++ b/api-website/_build/html/salesgpt/salesgpt.prompts.html @@ -1,11 +1,30 @@ - - + + + + + + + + + salesgpt.prompts module — SalesGPT documentation - + @@ -19,6 +38,17 @@ + + + + + diff --git a/api-website/_build/html/salesgpt/salesgpt.prompts_cn.html b/api-website/_build/html/salesgpt/salesgpt.prompts_cn.html index 00148eb0..f1cb501c 100644 --- a/api-website/_build/html/salesgpt/salesgpt.prompts_cn.html +++ b/api-website/_build/html/salesgpt/salesgpt.prompts_cn.html @@ -1,11 +1,30 @@ - - + + + + + + + + + salesgpt.prompts_cn module — SalesGPT documentation - + @@ -19,6 +38,17 @@ + + + + + diff --git a/api-website/_build/html/salesgpt/salesgpt.salesgptapi.html b/api-website/_build/html/salesgpt/salesgpt.salesgptapi.html index ca6c29e6..bd7ff8ff 100644 --- a/api-website/_build/html/salesgpt/salesgpt.salesgptapi.html +++ b/api-website/_build/html/salesgpt/salesgpt.salesgptapi.html @@ -1,11 +1,30 @@ - - + + + + + + + + + salesgpt.salesgptapi module — SalesGPT documentation - + @@ -19,6 +38,17 @@ + + + + + @@ -58,8 +88,9 @@
      • Prompts_cn
      • SalesGPT API @@ -98,16 +129,21 @@

        salesgpt.salesgptapi module

        -class salesgpt.salesgptapi.SalesGPTAPI(config_path: str, verbose: bool = False, max_num_turns: int = 10)
        +class salesgpt.salesgptapi.SalesGPTAPI(config_path: str, verbose: bool = True, max_num_turns: int = 20, model_name: str = 'gpt-3.5-turbo', product_catalog: str = 'examples/sample_product_catalog.txt', use_tools=True)

        Bases: object

        -
        -
        -USE_TOOLS = False
        +
        +
        +async do(human_input=None)
        -
        -do(conversation_history: [<class 'str'>], human_input=None)
        +
        +async do_stream(conversation_history: [<class 'str'>], human_input=None)
        +
        + +
        +
        +initialize_agent()
        diff --git a/api-website/_build/html/salesgpt/salesgpt.stages.html b/api-website/_build/html/salesgpt/salesgpt.stages.html index 873ebc97..7272c285 100644 --- a/api-website/_build/html/salesgpt/salesgpt.stages.html +++ b/api-website/_build/html/salesgpt/salesgpt.stages.html @@ -1,11 +1,30 @@ - - + + + + + + + + + salesgpt.stages module — SalesGPT documentation - + @@ -19,6 +38,17 @@ + + + + + diff --git a/api-website/_build/html/salesgpt/salesgpt.templates.html b/api-website/_build/html/salesgpt/salesgpt.templates.html index a5ed4744..aadab80b 100644 --- a/api-website/_build/html/salesgpt/salesgpt.templates.html +++ b/api-website/_build/html/salesgpt/salesgpt.templates.html @@ -1,11 +1,30 @@ - - + + + + + + + + + salesgpt.templates module — SalesGPT documentation - + @@ -19,6 +38,17 @@ + + + + + @@ -99,7 +129,7 @@

        salesgpt.templates module

        -class salesgpt.templates.CustomPromptTemplateForTools(*, name: str | None = None, input_variables: List[str], input_types: Dict[str, Any] = None, output_parser: BaseOutputParser | None = None, partial_variables: Mapping[str, Any] = None, metadata: Dict[str, Any] | None = None, tags: List[str] | None = None, template: str, tools_getter: Callable)
        +class salesgpt.templates.CustomPromptTemplateForTools(*, name: str | None = None, input_variables: List[str], input_types: Dict[str, Any] = None, output_parser: BaseOutputParser | None = None, partial_variables: Mapping[str, str | Callable[[], str]] = None, template: str, tools_getter: Callable)

        Bases: StringPromptTemplate

        diff --git a/api-website/_build/html/salesgpt/salesgpt.tools.html b/api-website/_build/html/salesgpt/salesgpt.tools.html index a6b696f3..30f481c2 100644 --- a/api-website/_build/html/salesgpt/salesgpt.tools.html +++ b/api-website/_build/html/salesgpt/salesgpt.tools.html @@ -1,11 +1,30 @@ - - + + + + + + + + + salesgpt.tools module — SalesGPT documentation - + @@ -19,6 +38,17 @@ + + + + + @@ -60,7 +90,14 @@
      • Stages
      • Templates
      • Tools
      • @@ -93,11 +130,51 @@

        salesgpt.tools module

        +
        +
        +salesgpt.tools.completion_bedrock(model_id, system_prompt, messages, max_tokens=1000)
        +

        High-level API call to generate a message with Anthropic Claude.

        +
        + +
        + +

        Generate a calendly invitation link based on the single query string

        +
        + +
        + +

        Generate a stripe payment link for a customer based on a single query string.

        +
        + +
        +
        +salesgpt.tools.get_mail_body_subject_from_query(query)
        +
        + +
        +
        +salesgpt.tools.get_product_id_from_query(query, product_price_id_mapping_path)
        +
        +
        -salesgpt.tools.get_tools(knowledge_base)
        +salesgpt.tools.get_tools(product_catalog)
        +
        +
        +salesgpt.tools.send_email_tool(query)
        +

        Sends an email based on the single query string

        +
        + +
        +
        +salesgpt.tools.send_email_with_gmail(email_details)
        +

        .env should include GMAIL_MAIL and GMAIL_APP_PASSWORD to work correctly

        +
        +
        salesgpt.tools.setup_knowledge_base(product_catalog: str = None, model_name: str = 'gpt-3.5-turbo')
        diff --git a/api-website/_build/html/salesgpt/salesgpt.version.html b/api-website/_build/html/salesgpt/salesgpt.version.html index 48d7e6c7..59574327 100644 --- a/api-website/_build/html/salesgpt/salesgpt.version.html +++ b/api-website/_build/html/salesgpt/salesgpt.version.html @@ -1,11 +1,30 @@ - - + + + + + + + + + salesgpt.version module — SalesGPT documentation - + @@ -19,6 +38,17 @@ + + + + + diff --git a/api-website/_build/html/search.html b/api-website/_build/html/search.html index 7945312a..4633bb08 100644 --- a/api-website/_build/html/search.html +++ b/api-website/_build/html/search.html @@ -2,9 +2,28 @@ + + + + + + + Search — SalesGPT documentation - + @@ -19,6 +38,17 @@ + + + + + diff --git a/api-website/_build/html/searchindex.js b/api-website/_build/html/searchindex.js index 30be12a5..effa7ebf 100644 --- a/api-website/_build/html/searchindex.js +++ b/api-website/_build/html/searchindex.js @@ -1 +1 @@ -Search.setIndex({"docnames": ["index", "salesgpt/modules", "salesgpt/salesgpt", "salesgpt/salesgpt.agents", "salesgpt/salesgpt.chains", "salesgpt/salesgpt.logger", "salesgpt/salesgpt.parsers", "salesgpt/salesgpt.prompts", "salesgpt/salesgpt.prompts_cn", "salesgpt/salesgpt.salesgptapi", "salesgpt/salesgpt.stages", "salesgpt/salesgpt.templates", "salesgpt/salesgpt.tools", "salesgpt/salesgpt.version"], "filenames": ["index.rst", "salesgpt/modules.rst", "salesgpt/salesgpt.rst", "salesgpt/salesgpt.agents.rst", "salesgpt/salesgpt.chains.rst", "salesgpt/salesgpt.logger.rst", "salesgpt/salesgpt.parsers.rst", "salesgpt/salesgpt.prompts.rst", "salesgpt/salesgpt.prompts_cn.rst", "salesgpt/salesgpt.salesgptapi.rst", "salesgpt/salesgpt.stages.rst", "salesgpt/salesgpt.templates.rst", "salesgpt/salesgpt.tools.rst", "salesgpt/salesgpt.version.rst"], "titles": ["Welcome to SalesGPT\u2019s documentation!", "salesgpt", "salesgpt package", "salesgpt.agents module", "salesgpt.chains module", "salesgpt.logger module", "salesgpt.parsers module", "salesgpt.prompts module", "salesgpt.prompts_cn module", "salesgpt.salesgptapi module", "salesgpt.stages module", "salesgpt.templates module", "salesgpt.tools module", "salesgpt.version module"], "terms": {"index": 0, "modul": [0, 1], "search": 0, "page": 0, "run": [], "run_api": [], "messagelist": [], "conversation_histori": [2, 3, 9], "human_sai": [], "model_config": [], "model_field": [], "chat_with_sales_ag": [], "say_hello": [], "packag": 1, "submodul": 1, "agent": [0, 1, 2, 4, 6], "acal": [2, 3], "acompletion_with_retri": [2, 3], "astep": [2, 3], "company_busi": [2, 3], "company_nam": [2, 3], "company_valu": [2, 3], "conversation_purpos": [2, 3], "conversation_stage_dict": [2, 3], "conversation_stage_id": [2, 3], "conversation_typ": [2, 3], "current_conversation_stag": [2, 3], "determine_conversation_stag": [2, 3], "from_llm": [2, 3, 4], "human_step": [2, 3], "input_kei": [2, 3], "knowledge_bas": [2, 3, 12], "model_nam": [2, 3, 12], "output_kei": [2, 3, 4], "retrieve_conversation_stag": [2, 3], "sales_agent_executor": [2, 3], "sales_conversation_utterance_chain": [2, 3], "salesperson_nam": [2, 3], "salesperson_rol": [2, 3], "seed_ag": [2, 3], "stage_analyzer_chain": [2, 3], "step": [2, 3], "use_tool": [2, 3, 9], "chain": [0, 1, 2, 3], "salesconversationchain": [0, 1, 2, 3, 4], "stageanalyzerchain": [0, 1, 2, 3, 4], "logger": [0, 1, 2], "timefilt": [0, 1, 2, 5], "filter": [2, 5], "time_logg": [0, 1, 2, 5], "parser": [0, 1, 2, 4], "salesconvooutputpars": [0, 1, 2, 6], "ai_prefix": [2, 6], "get_format_instruct": [2, 6], "pars": [2, 6], "verbos": [2, 3, 4, 6, 9], "prompt": [0, 1, 2, 3, 4, 11], "prompts_cn": [0, 1, 2], "salesgptapi": [0, 1, 2], "do": [2, 9], "stage": [0, 1, 2, 3, 4], "templat": [0, 1, 2], "customprompttemplatefortool": [0, 1, 2, 11], "format": [2, 3, 6, 11], "tools_gett": [2, 11], "tool": [0, 1, 2, 3], "get_tool": [0, 1, 2, 12], "setup_knowledge_bas": [0, 1, 2, 12], "version": [0, 1, 2], "content": 1, "class": [3, 4, 5, 6, 9, 11], "list": [3, 4, 11], "str": [3, 4, 6, 9, 11, 12], "base": [3, 4, 5, 6, 9, 11], "basemodel": [], "classvar": [], "configdict": [], "configur": [], "model": 3, "should": [3, 4, 5, 6], "dictionari": 3, "conform": [], "pydant": [], "config": [], "dict": [3, 4, 11], "fieldinfo": 3, "annot": [], "requir": [], "true": [3, 4, 5], "metadata": [3, 4, 11], "about": [], "field": [], "defin": [], "map": 11, "name": [3, 4, 5, 6, 11], "thi": [0, 3, 4, 5], "replac": [], "__fields__": [], "from": 3, "v1": [], "async": 3, "req": [], "memori": [3, 4], "basememori": [3, 4], "none": [3, 4, 6, 9, 11, 12], "callback": [3, 4], "basecallbackhandl": [3, 4], "basecallbackmanag": [3, 4], "callback_manag": [3, 4], "bool": [3, 4, 6, 9], "tag": [3, 4, 11], "ani": [0, 3, 4, 5, 11], "1": 3, "introduct": 3, "start": [3, 5], "convers": [3, 4], "introduc": 3, "yourself": 3, "your": 3, "compani": 3, "Be": 3, "polit": 3, "respect": 3, "while": 3, "keep": 3, "tone": 3, "profession": 3, "greet": 3, "welcom": 3, "alwai": 3, "clarifi": 3, "reason": 3, "why": 3, "you": [3, 4], "ar": [0, 3, 4, 5], "call": 3, "nonetyp": [], "agentexecutor": 3, "retrievalqa": 3, "2": 3, "qualif": 3, "qualifi": 3, "prospect": 3, "confirm": 3, "thei": 3, "right": 3, "person": 3, "talk": 3, "regard": 3, "product": [3, 12], "servic": 3, "ensur": 3, "have": [0, 3], "author": 3, "make": 3, "purchas": 3, "decis": 3, "3": [3, 12], "valu": 3, "proposit": 3, "briefli": 3, "explain": 3, "how": [3, 6], "can": 3, "benefit": 3, "focu": 3, "uniqu": 3, "sell": [3, 4], "point": 3, "set": 3, "apart": 3, "competitor": 3, "4": 3, "need": 3, "analysi": 3, "ask": 3, "open": 3, "end": [3, 5], "question": 3, "uncov": 3, "": 3, "pain": 3, "listen": 3, "carefulli": 3, "respons": [3, 4], "take": 3, "note": 3, "5": [3, 12], "solut": 3, "present": 3, "address": 3, "6": 3, "object": [3, 9], "handl": 3, "mai": [3, 5], "prepar": 3, "provid": 3, "evid": 3, "testimoni": 3, "support": 3, "claim": 3, "7": 3, "close": 3, "sale": [3, 4], "propos": 3, "next": [3, 4], "could": 3, "demo": 3, "trial": 3, "meet": 3, "maker": 3, "summar": 3, "what": 3, "ha": 3, "been": 3, "discuss": 3, "reiter": 3, "8": 3, "It": [3, 5], "time": [3, 5], "i": [3, 5, 12], "noth": 3, "els": 3, "said": 3, "gpt": [3, 12], "turbo": [3, 12], "0613": 3, "fals": [3, 4, 5, 6, 9], "ted": 3, "lasso": 3, "busi": 3, "develop": 3, "repres": 3, "sleep": 3, "haven": 3, "premium": 3, "mattress": 3, "custom": 3, "most": 3, "comfort": 3, "experi": 3, "possibl": 3, "we": [0, 3, 12], "offer": 3, "rang": 3, "high": 3, "qualiti": 3, "pillow": 3, "bed": 3, "accessori": 3, "design": 3, "our": 3, "mission": 3, "help": 3, "peopl": 3, "achiev": 3, "better": 3, "night": 3, "them": 3, "best": 3, "believ": 3, "essenti": 3, "overal": 3, "health": 3, "well": 3, "being": 3, "commit": 3, "optim": 3, "except": 3, "find": 3, "out": 3, "whether": 3, "look": 3, "via": 3, "bui": 3, "premier": 3, "control": 3, "arg": [3, 5, 11], "kwarg": [3, 11], "asynchron": 3, "execut": [3, 5], "input": [3, 11], "singl": 3, "expect": [], "onli": [], "one": [], "param": [], "contain": [], "all": [], "specifi": 5, "return_only_output": [], "return": [5, 11], "output": [3, 6], "If": [3, 5], "new": [], "kei": 3, "gener": [3, 4], "both": [], "default": 3, "us": 3, "These": [], "addit": 3, "pass": [3, 11], "dure": [], "construct": [], "runtim": [], "propag": [], "other": [], "string": [3, 11, 12], "option": 3, "associ": [], "include_run_info": [], "includ": [], "info": 5, "A": [3, 11], "llm": [3, 4, 6], "tenac": 3, "retri": 3, "complet": 3, "stream": 3, "manipul": 3, "chunk": 3, "downstream": 3, "applic": 3, "classmethod": [3, 4], "chatlitellm": [3, 4], "initi": 3, "human_input": [3, 9], "properti": 3, "baseprompttempl": 4, "runnabl": 4, "promptvalu": 4, "basemessag": 4, "text": [4, 6, 12], "output_pars": [4, 11], "basellmoutputpars": 4, "return_final_onli": 4, "llm_kwarg": 4, "llmchain": 4, "utter": [3, 4], "use_custom_prompt": 4, "custom_prompt": 4, "an": [3, 4], "ai": [4, 6], "me": 4, "pencil": 4, "get": [3, 4], "analyz": [3, 4], "which": [3, 4], "move": 4, "record": 5, "determin": [3, 5], "log": 5, "otherwis": [3, 5], "deem": 5, "appropri": 5, "modifi": 5, "place": 5, "func": 5, "decor": [3, 5], "function": [3, 5], "taken": 5, "agentoutputpars": 6, "instruct": 6, "agentact": 6, "agentfinish": 6, "action": 6, "finish": 6, "config_path": 9, "max_num_turn": 9, "int": 9, "10": 9, "input_vari": 11, "input_typ": 11, "baseoutputpars": 11, "partial_vari": 11, "callabl": [5, 11], "stringprompttempl": 11, "argument": [3, 11], "exampl": 11, "variable1": 11, "foo": 11, "product_catalog": 12, "assum": 12, "catalog": 12, "simpli": 12, "inform": 13, "red": [], "just": 0, "begun": 0, "build": 0, "websit": 0, "still": 0, "activ": 0, "work": 0, "suggest": 0, "improv": 0, "readabl": 0, "desir": 0, "pleas": 0, "contact": 0, "chemik": 0, "bit": 0, "github": 0, "more": [], "add": [], "toctre": [], "maxdepth": [], "caption": [], "type": [], "variabl": 3, "sequenc": 4, "tupl": [3, 4], "ellipsi": 3, "extra": 3, "deprec": [], "sinc": [], "0": [], "ainvok": [], "instead": [], "method": 3, "implement": 3, "yet": 3, "length": 3, "arbitrari": 3, "keyword": 3, "rais": [], "notimplementederror": 3, "current": 3, "indic": 3, "librari": 3, "case": 3, "failur": 3, "creat": 3, "_create_retry_decor": 3, "appli": 3, "_completion_with_retri": 3, "actual": 3, "The": [3, 5], "languag": 3, "result": 3, "fail": 3, "after": [3, 5], "maximum": 3, "number": 3, "_acal": 3, "empti": 3, "flag": 3, "histori": 3, "join": 3, "each": 3, "entri": 3, "separ": 3, "newlin": 3, "charact": 3, "id": 3, "also": 3, "print": 3, "retriev": 3, "correspond": 3, "final": 3, "process": 3, "human": 3, "append": 3, "ad": 3, "user": 3, "begin": 3, "end_of_turn": 3, "overridden": 3, "subclass": 3, "extract": 3, "data": 3, "up": 3, "found": 3, "seed": 3, "clear": 3, "reset": 3, "_call": 3, "befor": 5, "calcul": 5, "level": 5, "given": 3, "instanc": 3, "check": 3, "knowledg": 3, "executor": 3, "enabl": 3, "api": 0, "doc": [], "raw": [], "html": [], "div": [], "wy": [], "menu": [], "href": [], "http": [], "vercel": [], "app": [], "btn": [], "primari": []}, "objects": {"": [[2, 0, 0, "-", "salesgpt"]], "salesgpt": [[3, 0, 0, "-", "agents"], [4, 0, 0, "-", "chains"], [5, 0, 0, "-", "logger"], [6, 0, 0, "-", "parsers"], [7, 0, 0, "-", "prompts"], [8, 0, 0, "-", "prompts_cn"], [9, 0, 0, "-", "salesgptapi"], [10, 0, 0, "-", "stages"], [11, 0, 0, "-", "templates"], [12, 0, 0, "-", "tools"], [13, 0, 0, "-", "version"]], "salesgpt.agents": [[3, 1, 1, "", "SalesGPT"]], "salesgpt.agents.SalesGPT": [[3, 2, 1, "", "acall"], [3, 2, 1, "", "acompletion_with_retry"], [3, 2, 1, "", "astep"], [3, 3, 1, "", "company_business"], [3, 3, 1, "", "company_name"], [3, 3, 1, "", "company_values"], [3, 3, 1, "", "conversation_history"], [3, 3, 1, "", "conversation_purpose"], [3, 3, 1, "", "conversation_stage_dict"], [3, 3, 1, "", "conversation_stage_id"], [3, 3, 1, "", "conversation_type"], [3, 3, 1, "", "current_conversation_stage"], [3, 2, 1, "", "determine_conversation_stage"], [3, 2, 1, "", "from_llm"], [3, 2, 1, "", "human_step"], [3, 4, 1, "", "input_keys"], [3, 3, 1, "", "knowledge_base"], [3, 3, 1, "", "model_name"], [3, 4, 1, "", "output_keys"], [3, 2, 1, "", "retrieve_conversation_stage"], [3, 3, 1, "", "sales_agent_executor"], [3, 3, 1, "", "sales_conversation_utterance_chain"], [3, 3, 1, "", "salesperson_name"], [3, 3, 1, "", "salesperson_role"], [3, 2, 1, "", "seed_agent"], [3, 3, 1, "", "stage_analyzer_chain"], [3, 2, 1, "", "step"], [3, 3, 1, "", "use_tools"]], "salesgpt.chains": [[4, 1, 1, "", "SalesConversationChain"], [4, 1, 1, "", "StageAnalyzerChain"]], "salesgpt.chains.SalesConversationChain": [[4, 2, 1, "", "from_llm"]], "salesgpt.chains.StageAnalyzerChain": [[4, 2, 1, "", "from_llm"]], "salesgpt.logger": [[5, 1, 1, "", "TimeFilter"], [5, 5, 1, "", "time_logger"]], "salesgpt.logger.TimeFilter": [[5, 2, 1, "", "filter"]], "salesgpt.parsers": [[6, 1, 1, "", "SalesConvoOutputParser"]], "salesgpt.parsers.SalesConvoOutputParser": [[6, 3, 1, "", "ai_prefix"], [6, 2, 1, "", "get_format_instructions"], [6, 2, 1, "", "parse"], [6, 3, 1, "", "verbose"]], "salesgpt.salesgptapi": [[9, 1, 1, "", "SalesGPTAPI"]], "salesgpt.salesgptapi.SalesGPTAPI": [[9, 3, 1, "", "USE_TOOLS"], [9, 2, 1, "", "do"]], "salesgpt.templates": [[11, 1, 1, "", "CustomPromptTemplateForTools"]], "salesgpt.templates.CustomPromptTemplateForTools": [[11, 2, 1, "", "format"], [11, 3, 1, "", "template"], [11, 3, 1, "", "tools_getter"]], "salesgpt.tools": [[12, 5, 1, "", "get_tools"], [12, 5, 1, "", "setup_knowledge_base"]]}, "objtypes": {"0": "py:module", "1": "py:class", "2": "py:method", "3": "py:attribute", "4": "py:property", "5": "py:function"}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "class", "Python class"], "2": ["py", "method", "Python method"], "3": ["py", "attribute", "Python attribute"], "4": ["py", "property", "Python property"], "5": ["py", "function", "Python function"]}, "titleterms": {"welcom": 0, "salesgpt": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13], "": 0, "document": 0, "indic": 0, "tabl": 0, "run": [], "modul": [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13], "run_api": [], "packag": 2, "submodul": 2, "agent": 3, "chain": 4, "logger": 5, "parser": 6, "prompt": 7, "prompts_cn": 8, "salesgptapi": 9, "stage": 10, "templat": 11, "tool": 12, "version": 13, "content": [0, 2], "note": [], "paramet": 3, "rais": 3, "return": 3}, "envversion": {"sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx": 60}, "alltitles": {"salesgpt": [[1, "salesgpt"]], "salesgpt package": [[2, "salesgpt-package"]], "Submodules": [[2, "submodules"]], "Contents:": [[2, null], [0, null]], "Module contents": [[2, "module-salesgpt"]], "salesgpt.agents module": [[3, "module-salesgpt.agents"]], "Parameters": [[3, "parameters"], [3, "id1"], [3, "id3"]], "Raises": [[3, "raises"], [3, "id2"]], "Returns": [[3, "returns"], [3, "id4"]], "salesgpt.chains module": [[4, "module-salesgpt.chains"]], "salesgpt.logger module": [[5, "module-salesgpt.logger"]], "salesgpt.parsers module": [[6, "module-salesgpt.parsers"]], "salesgpt.prompts module": [[7, "module-salesgpt.prompts"]], "salesgpt.prompts_cn module": [[8, "module-salesgpt.prompts_cn"]], "salesgpt.salesgptapi module": [[9, "module-salesgpt.salesgptapi"]], "salesgpt.stages module": [[10, "module-salesgpt.stages"]], "salesgpt.templates module": [[11, "module-salesgpt.templates"]], "salesgpt.tools module": [[12, "module-salesgpt.tools"]], "salesgpt.version module": [[13, "module-salesgpt.version"]], "Welcome to SalesGPT\u2019s documentation!": [[0, "welcome-to-salesgpt-s-documentation"]], "Indices and tables": [[0, "indices-and-tables"]]}, "indexentries": {"module": [[2, "module-salesgpt"], [3, "module-salesgpt.agents"], [4, "module-salesgpt.chains"], [5, "module-salesgpt.logger"], [6, "module-salesgpt.parsers"], [7, "module-salesgpt.prompts"], [8, "module-salesgpt.prompts_cn"], [9, "module-salesgpt.salesgptapi"], [10, "module-salesgpt.stages"], [11, "module-salesgpt.templates"], [12, "module-salesgpt.tools"], [13, "module-salesgpt.version"]], "salesgpt": [[2, "module-salesgpt"]], "salesgpt (class in salesgpt.agents)": [[3, "salesgpt.agents.SalesGPT"]], "acall() (salesgpt.agents.salesgpt method)": [[3, "salesgpt.agents.SalesGPT.acall"]], "acompletion_with_retry() (salesgpt.agents.salesgpt method)": [[3, "salesgpt.agents.SalesGPT.acompletion_with_retry"]], "astep() (salesgpt.agents.salesgpt method)": [[3, "salesgpt.agents.SalesGPT.astep"]], "company_business (salesgpt.agents.salesgpt attribute)": [[3, "salesgpt.agents.SalesGPT.company_business"]], "company_name (salesgpt.agents.salesgpt attribute)": [[3, "salesgpt.agents.SalesGPT.company_name"]], "company_values (salesgpt.agents.salesgpt attribute)": [[3, "salesgpt.agents.SalesGPT.company_values"]], "conversation_history (salesgpt.agents.salesgpt attribute)": [[3, "salesgpt.agents.SalesGPT.conversation_history"]], "conversation_purpose (salesgpt.agents.salesgpt attribute)": [[3, "salesgpt.agents.SalesGPT.conversation_purpose"]], "conversation_stage_dict (salesgpt.agents.salesgpt attribute)": [[3, "salesgpt.agents.SalesGPT.conversation_stage_dict"]], "conversation_stage_id (salesgpt.agents.salesgpt attribute)": [[3, "salesgpt.agents.SalesGPT.conversation_stage_id"]], "conversation_type (salesgpt.agents.salesgpt attribute)": [[3, "salesgpt.agents.SalesGPT.conversation_type"]], "current_conversation_stage (salesgpt.agents.salesgpt attribute)": [[3, "salesgpt.agents.SalesGPT.current_conversation_stage"]], "determine_conversation_stage() (salesgpt.agents.salesgpt method)": [[3, "salesgpt.agents.SalesGPT.determine_conversation_stage"]], "from_llm() (salesgpt.agents.salesgpt class method)": [[3, "salesgpt.agents.SalesGPT.from_llm"]], "human_step() (salesgpt.agents.salesgpt method)": [[3, "salesgpt.agents.SalesGPT.human_step"]], "input_keys (salesgpt.agents.salesgpt property)": [[3, "salesgpt.agents.SalesGPT.input_keys"]], "knowledge_base (salesgpt.agents.salesgpt attribute)": [[3, "salesgpt.agents.SalesGPT.knowledge_base"]], "model_name (salesgpt.agents.salesgpt attribute)": [[3, "salesgpt.agents.SalesGPT.model_name"]], "output_keys (salesgpt.agents.salesgpt property)": [[3, "salesgpt.agents.SalesGPT.output_keys"]], "retrieve_conversation_stage() (salesgpt.agents.salesgpt method)": [[3, "salesgpt.agents.SalesGPT.retrieve_conversation_stage"]], "sales_agent_executor (salesgpt.agents.salesgpt attribute)": [[3, "salesgpt.agents.SalesGPT.sales_agent_executor"]], "sales_conversation_utterance_chain (salesgpt.agents.salesgpt attribute)": [[3, "salesgpt.agents.SalesGPT.sales_conversation_utterance_chain"]], "salesgpt.agents": [[3, "module-salesgpt.agents"]], "salesperson_name (salesgpt.agents.salesgpt attribute)": [[3, "salesgpt.agents.SalesGPT.salesperson_name"]], "salesperson_role (salesgpt.agents.salesgpt attribute)": [[3, "salesgpt.agents.SalesGPT.salesperson_role"]], "seed_agent() (salesgpt.agents.salesgpt method)": [[3, "salesgpt.agents.SalesGPT.seed_agent"]], "stage_analyzer_chain (salesgpt.agents.salesgpt attribute)": [[3, "salesgpt.agents.SalesGPT.stage_analyzer_chain"]], "step() (salesgpt.agents.salesgpt method)": [[3, "salesgpt.agents.SalesGPT.step"]], "use_tools (salesgpt.agents.salesgpt attribute)": [[3, "salesgpt.agents.SalesGPT.use_tools"]], "salesconversationchain (class in salesgpt.chains)": [[4, "salesgpt.chains.SalesConversationChain"]], "stageanalyzerchain (class in salesgpt.chains)": [[4, "salesgpt.chains.StageAnalyzerChain"]], "from_llm() (salesgpt.chains.salesconversationchain class method)": [[4, "salesgpt.chains.SalesConversationChain.from_llm"]], "from_llm() (salesgpt.chains.stageanalyzerchain class method)": [[4, "salesgpt.chains.StageAnalyzerChain.from_llm"]], "salesgpt.chains": [[4, "module-salesgpt.chains"]], "timefilter (class in salesgpt.logger)": [[5, "salesgpt.logger.TimeFilter"]], "filter() (salesgpt.logger.timefilter method)": [[5, "salesgpt.logger.TimeFilter.filter"]], "salesgpt.logger": [[5, "module-salesgpt.logger"]], "time_logger() (in module salesgpt.logger)": [[5, "salesgpt.logger.time_logger"]], "salesconvooutputparser (class in salesgpt.parsers)": [[6, "salesgpt.parsers.SalesConvoOutputParser"]], "ai_prefix (salesgpt.parsers.salesconvooutputparser attribute)": [[6, "salesgpt.parsers.SalesConvoOutputParser.ai_prefix"]], "get_format_instructions() (salesgpt.parsers.salesconvooutputparser method)": [[6, "salesgpt.parsers.SalesConvoOutputParser.get_format_instructions"]], "parse() (salesgpt.parsers.salesconvooutputparser method)": [[6, "salesgpt.parsers.SalesConvoOutputParser.parse"]], "salesgpt.parsers": [[6, "module-salesgpt.parsers"]], "verbose (salesgpt.parsers.salesconvooutputparser attribute)": [[6, "salesgpt.parsers.SalesConvoOutputParser.verbose"]], "salesgpt.prompts": [[7, "module-salesgpt.prompts"]], "salesgpt.prompts_cn": [[8, "module-salesgpt.prompts_cn"]], "salesgptapi (class in salesgpt.salesgptapi)": [[9, "salesgpt.salesgptapi.SalesGPTAPI"]], "use_tools (salesgpt.salesgptapi.salesgptapi attribute)": [[9, "salesgpt.salesgptapi.SalesGPTAPI.USE_TOOLS"]], "do() (salesgpt.salesgptapi.salesgptapi method)": [[9, "salesgpt.salesgptapi.SalesGPTAPI.do"]], "salesgpt.salesgptapi": [[9, "module-salesgpt.salesgptapi"]], "salesgpt.stages": [[10, "module-salesgpt.stages"]], "customprompttemplatefortools (class in salesgpt.templates)": [[11, "salesgpt.templates.CustomPromptTemplateForTools"]], "format() (salesgpt.templates.customprompttemplatefortools method)": [[11, "salesgpt.templates.CustomPromptTemplateForTools.format"]], "salesgpt.templates": [[11, "module-salesgpt.templates"]], "template (salesgpt.templates.customprompttemplatefortools attribute)": [[11, "salesgpt.templates.CustomPromptTemplateForTools.template"]], "tools_getter (salesgpt.templates.customprompttemplatefortools attribute)": [[11, "salesgpt.templates.CustomPromptTemplateForTools.tools_getter"]], "get_tools() (in module salesgpt.tools)": [[12, "salesgpt.tools.get_tools"]], "salesgpt.tools": [[12, "module-salesgpt.tools"]], "setup_knowledge_base() (in module salesgpt.tools)": [[12, "salesgpt.tools.setup_knowledge_base"]], "salesgpt.version": [[13, "module-salesgpt.version"]]}}) \ No newline at end of file +Search.setIndex({"docnames": ["googleanalytics/README", "index", "salesgpt/modules", "salesgpt/salesgpt", "salesgpt/salesgpt.agents", "salesgpt/salesgpt.chains", "salesgpt/salesgpt.logger", "salesgpt/salesgpt.parsers", "salesgpt/salesgpt.prompts", "salesgpt/salesgpt.prompts_cn", "salesgpt/salesgpt.salesgptapi", "salesgpt/salesgpt.stages", "salesgpt/salesgpt.templates", "salesgpt/salesgpt.tools", "salesgpt/salesgpt.version"], "filenames": ["googleanalytics/README.rst", "index.rst", "salesgpt/modules.rst", "salesgpt/salesgpt.rst", "salesgpt/salesgpt.agents.rst", "salesgpt/salesgpt.chains.rst", "salesgpt/salesgpt.logger.rst", "salesgpt/salesgpt.parsers.rst", "salesgpt/salesgpt.prompts.rst", "salesgpt/salesgpt.prompts_cn.rst", "salesgpt/salesgpt.salesgptapi.rst", "salesgpt/salesgpt.stages.rst", "salesgpt/salesgpt.templates.rst", "salesgpt/salesgpt.tools.rst", "salesgpt/salesgpt.version.rst"], "titles": ["Google Analytics extension for Sphinx", "Welcome to SalesGPT\u2019s documentation!", "salesgpt", "salesgpt package", "salesgpt.agents module", "salesgpt.chains module", "salesgpt.logger module", "salesgpt.parsers module", "salesgpt.prompts module", "salesgpt.prompts_cn module", "salesgpt.salesgptapi module", "salesgpt.stages module", "salesgpt.templates module", "salesgpt.tools module", "salesgpt.version module"], "terms": {"index": 1, "modul": [0, 1, 2], "search": 1, "page": 1, "run": [], "run_api": [], "messagelist": [], "conversation_histori": [3, 4, 10], "human_sai": [], "model_config": [], "model_field": [], "chat_with_sales_ag": [], "say_hello": [], "packag": 2, "submodul": 2, "agent": [1, 2, 3, 5, 7], "acal": [3, 4], "acompletion_with_retri": [3, 4], "astep": [3, 4], "company_busi": [3, 4], "company_nam": [3, 4], "company_valu": [3, 4], "conversation_purpos": [3, 4], "conversation_stage_dict": [3, 4], "conversation_stage_id": [3, 4], "conversation_typ": [3, 4], "current_conversation_stag": [3, 4], "determine_conversation_stag": [3, 4], "from_llm": [3, 4, 5], "human_step": [3, 4], "input_kei": [3, 4], "knowledge_bas": [3, 4], "model_nam": [3, 4, 10, 13], "output_kei": [3, 4, 5], "retrieve_conversation_stag": [3, 4], "sales_agent_executor": [3, 4], "sales_conversation_utterance_chain": [3, 4], "salesperson_nam": [3, 4], "salesperson_rol": [3, 4], "seed_ag": [3, 4], "stage_analyzer_chain": [3, 4], "step": [3, 4], "use_tool": [3, 4, 10], "chain": [1, 2, 3, 4], "salesconversationchain": [1, 2, 3, 4, 5], "stageanalyzerchain": [1, 2, 3, 4, 5], "logger": [1, 2, 3], "timefilt": [1, 2, 3, 6], "filter": [3, 6], "time_logg": [1, 2, 3, 6], "parser": [1, 2, 3, 5], "salesconvooutputpars": [1, 2, 3, 7], "ai_prefix": [3, 7], "get_format_instruct": [3, 7], "pars": [3, 7], "verbos": [3, 4, 5, 7, 10], "prompt": [1, 2, 3, 4, 5, 12], "prompts_cn": [1, 2, 3], "salesgptapi": [1, 2, 3], "do": [3, 10], "stage": [1, 2, 3, 4, 5], "templat": [1, 2, 3], "customprompttemplatefortool": [1, 2, 3, 12], "format": [3, 4, 7, 12], "tools_gett": [3, 12], "tool": [1, 2, 3, 4], "get_tool": [1, 2, 3, 13], "setup_knowledge_bas": [1, 2, 3, 13], "version": [1, 2, 3], "content": 2, "class": [4, 5, 6, 7, 10, 12], "list": [0, 4, 5, 12], "str": [4, 5, 7, 10, 12, 13], "base": [4, 5, 6, 7, 10, 12, 13], "basemodel": [], "classvar": [], "configdict": [], "configur": [], "model": 4, "should": [4, 5, 6, 7, 13], "dictionari": 4, "conform": [], "pydant": [], "config": [], "dict": [4, 5, 12], "fieldinfo": 4, "annot": 4, "requir": 4, "true": [0, 4, 5, 6, 10], "metadata": [4, 5], "about": [], "field": [], "defin": [], "map": 12, "name": [4, 5, 6, 7, 12], "thi": [0, 1, 4, 5, 6], "replac": [], "__fields__": [], "from": 4, "v1": [], "async": [4, 10], "req": [], "memori": [4, 5], "basememori": [4, 5], "none": [4, 5, 7, 10, 12, 13], "callback": [4, 5], "basecallbackhandl": [4, 5], "basecallbackmanag": [4, 5], "callback_manag": [4, 5], "bool": [0, 4, 5, 7, 10], "tag": [4, 5], "ani": [1, 4, 5, 6, 12], "1": 4, "introduct": 4, "start": [4, 6], "convers": [4, 5], "introduc": 4, "yourself": 4, "your": [0, 4], "compani": 4, "Be": 4, "polit": 4, "respect": 4, "while": 4, "keep": 4, "tone": 4, "profession": 4, "greet": 4, "welcom": 4, "alwai": 4, "clarifi": 4, "reason": 4, "why": 4, "you": [0, 4, 5], "ar": [1, 4, 5, 6], "call": [4, 13], "nonetyp": 4, "agentexecutor": [], "retrievalqa": 4, "2": 4, "qualif": 4, "qualifi": 4, "prospect": 4, "confirm": 4, "thei": 4, "right": 4, "person": 4, "talk": 4, "regard": 4, "product": [4, 13], "servic": [0, 4], "ensur": 4, "have": [1, 4], "author": [0, 4], "make": 4, "purchas": 4, "decis": 4, "3": [4, 10, 13], "valu": 4, "proposit": 4, "briefli": 4, "explain": 4, "how": [4, 7], "can": [0, 4], "benefit": 4, "focu": 4, "uniqu": 4, "sell": [4, 5], "point": 4, "set": [0, 4], "apart": 4, "competitor": 4, "4": 4, "need": 4, "analysi": 4, "ask": 4, "open": 4, "end": [4, 6], "question": 4, "uncov": 4, "": 4, "pain": 4, "listen": 4, "carefulli": 4, "respons": [4, 5], "take": 4, "note": 4, "5": [4, 10, 13], "solut": 4, "present": 4, "address": 4, "6": 4, "object": [4, 10], "handl": 4, "mai": [4, 6], "prepar": 4, "provid": 4, "evid": 4, "testimoni": 4, "support": 4, "claim": 4, "7": 4, "close": 4, "sale": [4, 5], "propos": 4, "next": [4, 5], "could": 4, "demo": 4, "trial": 4, "meet": 4, "maker": 4, "summar": 4, "what": 4, "ha": 4, "been": 4, "discuss": 4, "reiter": 4, "8": 4, "It": [0, 4, 6], "time": [4, 6], "i": [0, 4, 6, 13], "noth": 4, "els": 4, "said": 4, "gpt": [4, 10, 13], "turbo": [4, 10, 13], "0613": 4, "fals": [4, 5, 6, 7], "ted": 4, "lasso": 4, "busi": 4, "develop": 4, "repres": 4, "sleep": 4, "haven": 4, "premium": 4, "mattress": 4, "custom": [4, 13], "most": 4, "comfort": 4, "experi": 4, "possibl": 4, "we": [1, 4, 13], "offer": 4, "rang": 4, "high": [4, 13], "qualiti": 4, "pillow": 4, "bed": 4, "accessori": 4, "design": 4, "our": 4, "mission": 4, "help": 4, "peopl": 4, "achiev": 4, "better": 4, "night": 4, "them": 4, "best": 4, "believ": 4, "essenti": 4, "overal": 4, "health": 4, "well": 4, "being": 4, "commit": 4, "optim": 4, "except": 4, "find": 4, "out": 4, "whether": 4, "look": 4, "via": 4, "bui": 4, "premier": 4, "control": 4, "arg": [4, 6, 12], "kwarg": [4, 12], "asynchron": 4, "execut": [4, 6], "input": [4, 12], "singl": [4, 13], "expect": [], "onli": [], "one": [0, 4], "param": [], "contain": [], "all": [], "specifi": 6, "return_only_output": [], "return": [6, 12], "output": [4, 7], "If": [4, 6], "new": [], "kei": 4, "gener": [0, 4, 5, 13], "both": [], "default": [0, 4], "us": [0, 4], "These": [], "addit": 4, "pass": [4, 12], "dure": [], "construct": [], "runtim": [], "propag": [], "other": [], "string": [0, 4, 12, 13], "option": [0, 4], "associ": [], "include_run_info": [], "includ": 13, "info": 6, "A": [4, 12], "llm": [4, 5, 7], "tenac": 4, "retri": 4, "complet": 4, "stream": 4, "manipul": 4, "chunk": 4, "downstream": 4, "applic": 4, "classmethod": [4, 5], "chatlitellm": [4, 5], "initi": 4, "human_input": [4, 10], "properti": 4, "baseprompttempl": 5, "runnabl": 5, "promptvalu": 5, "basemessag": 5, "text": [5, 7, 13], "output_pars": [5, 12], "basellmoutputpars": 5, "return_final_onli": 5, "llm_kwarg": 5, "llmchain": 5, "utter": [4, 5], "use_custom_prompt": 5, "custom_prompt": 5, "an": [4, 5, 13], "ai": [4, 5, 7], "me": 5, "pencil": 5, "get": [4, 5], "analyz": [4, 5], "which": [4, 5], "move": 5, "record": 6, "determin": [4, 6], "log": 6, "otherwis": [4, 6], "deem": 6, "appropri": 6, "modifi": 6, "place": 6, "func": 6, "decor": [4, 6], "function": [4, 6], "taken": 6, "agentoutputpars": 7, "instruct": 7, "agentact": 7, "agentfinish": 7, "action": 7, "finish": 7, "config_path": 10, "max_num_turn": 10, "int": 10, "10": [], "input_vari": 12, "input_typ": 12, "baseoutputpars": 12, "partial_vari": 12, "callabl": [6, 12], "stringprompttempl": 12, "argument": [4, 12], "exampl": [0, 10, 12], "variable1": 12, "foo": 12, "product_catalog": [10, 13], "assum": 13, "catalog": 13, "simpli": 13, "inform": 14, "red": [], "just": [0, 1], "begun": 1, "build": 1, "websit": 1, "still": 1, "activ": 1, "work": [1, 13], "suggest": 1, "improv": 1, "readabl": 1, "desir": 1, "pleas": 1, "contact": 1, "chemik": 1, "bit": 1, "github": [0, 1], "more": [], "add": [0, 4], "toctre": [], "maxdepth": [], "caption": [], "type": [], "variabl": [], "sequenc": 5, "tupl": [], "ellipsi": [], "extra": [], "deprec": [], "sinc": [], "0": [], "ainvok": [], "instead": [], "method": 4, "implement": [], "yet": [], "length": [], "arbitrari": [], "keyword": 4, "rais": [], "notimplementederror": [], "current": 4, "indic": 4, "librari": 4, "case": 4, "failur": 4, "creat": 4, "_create_retry_decor": 4, "appli": 4, "_completion_with_retri": 4, "actual": 4, "The": [4, 6], "languag": 4, "result": 4, "fail": 4, "after": [4, 6], "maximum": 4, "number": 4, "_acal": 4, "empti": 4, "flag": 4, "histori": 4, "join": 4, "each": 4, "entri": 4, "separ": 4, "newlin": 4, "charact": 4, "id": [0, 4], "also": 4, "print": 4, "retriev": 4, "correspond": 4, "final": 4, "process": 4, "human": 4, "append": 4, "ad": [0, 4], "user": 4, "begin": 4, "end_of_turn": 4, "overridden": 4, "subclass": 4, "extract": 4, "data": 4, "up": 4, "found": 4, "seed": 4, "clear": 4, "reset": 4, "_call": 4, "befor": 6, "calcul": 6, "level": [6, 13], "given": 4, "instanc": 4, "check": 4, "knowledg": 4, "executor": 4, "enabl": 4, "api": [1, 13], "doc": [], "raw": [], "html": 0, "div": [], "wy": [], "menu": [], "href": [], "http": 0, "vercel": [], "app": [], "btn": [], "primari": [], "do_stream": [3, 10], "initialize_ag": [3, 10], "customagentexecutor": 4, "20": 10, "completion_bedrock": [1, 2, 3, 13], "generate_calendly_invitation_link": [1, 2, 3, 13], "generate_stripe_payment_link": [1, 2, 3, 13], "get_mail_body_subject_from_queri": [1, 2, 3, 13], "get_product_id_from_queri": [1, 2, 3, 13], "send_email_tool": [1, 2, 3, 13], "send_email_with_gmail": [1, 2, 3, 13], "adetermine_conversation_stag": [3, 4], "overrid": 4, "temporarili": 4, "state": 4, "either": 4, "messag": [4, 13], "sample_product_catalog": 10, "txt": 10, "model_id": 13, "system_prompt": 13, "max_token": 13, "1000": 13, "anthrop": 13, "claud": 13, "queri": 13, "calendli": 13, "invit": 13, "link": 13, "stripe": 13, "payment": 13, "product_price_id_mapping_path": 13, "send": 13, "email": 13, "email_detail": 13, "env": 13, "gmail_mail": 13, "gmail_app_password": 13, "correctli": 13, "domen": 0, "ko\u017ear": 0, "dev": 0, "si": 0, "allow": 0, "track": 0, "file": 0, "web": 0, "googleanalyt": 0, "git": 0, "clone": 0, "com": 0, "chang": 0, "directori": 0, "cd": 0, "python": 0, "setup": 0, "py": 0, "sphinxcontrib": 0, "conf": 0, "For": 0, "now": 0, "googleanalytics_id": 0, "ua": 0, "site": 0, "123": 0, "googleanalytics_en": 0, "turn": 0, "off": 0}, "objects": {"": [[3, 0, 0, "-", "salesgpt"]], "salesgpt": [[4, 0, 0, "-", "agents"], [5, 0, 0, "-", "chains"], [6, 0, 0, "-", "logger"], [7, 0, 0, "-", "parsers"], [8, 0, 0, "-", "prompts"], [9, 0, 0, "-", "prompts_cn"], [10, 0, 0, "-", "salesgptapi"], [11, 0, 0, "-", "stages"], [12, 0, 0, "-", "templates"], [13, 0, 0, "-", "tools"], [14, 0, 0, "-", "version"]], "salesgpt.agents": [[4, 1, 1, "", "SalesGPT"]], "salesgpt.agents.SalesGPT": [[4, 2, 1, "", "acall"], [4, 2, 1, "", "acompletion_with_retry"], [4, 2, 1, "", "adetermine_conversation_stage"], [4, 2, 1, "", "astep"], [4, 3, 1, "", "company_business"], [4, 3, 1, "", "company_name"], [4, 3, 1, "", "company_values"], [4, 3, 1, "", "conversation_history"], [4, 3, 1, "", "conversation_purpose"], [4, 3, 1, "", "conversation_stage_dict"], [4, 3, 1, "", "conversation_stage_id"], [4, 3, 1, "", "conversation_type"], [4, 3, 1, "", "current_conversation_stage"], [4, 2, 1, "", "determine_conversation_stage"], [4, 2, 1, "", "from_llm"], [4, 2, 1, "", "human_step"], [4, 4, 1, "", "input_keys"], [4, 3, 1, "", "knowledge_base"], [4, 3, 1, "", "model_name"], [4, 4, 1, "", "output_keys"], [4, 2, 1, "", "retrieve_conversation_stage"], [4, 3, 1, "", "sales_agent_executor"], [4, 3, 1, "", "sales_conversation_utterance_chain"], [4, 3, 1, "", "salesperson_name"], [4, 3, 1, "", "salesperson_role"], [4, 2, 1, "", "seed_agent"], [4, 3, 1, "", "stage_analyzer_chain"], [4, 2, 1, "", "step"], [4, 3, 1, "", "use_tools"]], "salesgpt.chains": [[5, 1, 1, "", "SalesConversationChain"], [5, 1, 1, "", "StageAnalyzerChain"]], "salesgpt.chains.SalesConversationChain": [[5, 2, 1, "", "from_llm"]], "salesgpt.chains.StageAnalyzerChain": [[5, 2, 1, "", "from_llm"]], "salesgpt.logger": [[6, 1, 1, "", "TimeFilter"], [6, 5, 1, "", "time_logger"]], "salesgpt.logger.TimeFilter": [[6, 2, 1, "", "filter"]], "salesgpt.parsers": [[7, 1, 1, "", "SalesConvoOutputParser"]], "salesgpt.parsers.SalesConvoOutputParser": [[7, 3, 1, "", "ai_prefix"], [7, 2, 1, "", "get_format_instructions"], [7, 2, 1, "", "parse"], [7, 3, 1, "", "verbose"]], "salesgpt.salesgptapi": [[10, 1, 1, "", "SalesGPTAPI"]], "salesgpt.salesgptapi.SalesGPTAPI": [[10, 2, 1, "", "do"], [10, 2, 1, "", "do_stream"], [10, 2, 1, "", "initialize_agent"]], "salesgpt.templates": [[12, 1, 1, "", "CustomPromptTemplateForTools"]], "salesgpt.templates.CustomPromptTemplateForTools": [[12, 2, 1, "", "format"], [12, 3, 1, "", "template"], [12, 3, 1, "", "tools_getter"]], "salesgpt.tools": [[13, 5, 1, "", "completion_bedrock"], [13, 5, 1, "", "generate_calendly_invitation_link"], [13, 5, 1, "", "generate_stripe_payment_link"], [13, 5, 1, "", "get_mail_body_subject_from_query"], [13, 5, 1, "", "get_product_id_from_query"], [13, 5, 1, "", "get_tools"], [13, 5, 1, "", "send_email_tool"], [13, 5, 1, "", "send_email_with_gmail"], [13, 5, 1, "", "setup_knowledge_base"]]}, "objtypes": {"0": "py:module", "1": "py:class", "2": "py:method", "3": "py:attribute", "4": "py:property", "5": "py:function"}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "class", "Python class"], "2": ["py", "method", "Python method"], "3": ["py", "attribute", "Python attribute"], "4": ["py", "property", "Python property"], "5": ["py", "function", "Python function"]}, "titleterms": {"welcom": 1, "salesgpt": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], "": 1, "document": 1, "indic": 1, "tabl": 1, "run": [], "modul": [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], "run_api": [], "packag": 3, "submodul": 3, "agent": 4, "chain": 5, "logger": 6, "parser": 7, "prompt": 8, "prompts_cn": 9, "salesgptapi": 10, "stage": 11, "templat": 12, "tool": 13, "version": 14, "content": [1, 3], "note": [], "paramet": 4, "rais": 4, "return": 4, "googl": 0, "analyt": 0, "extens": 0, "sphinx": 0, "about": 0, "instal": 0, "from": 0, "contrib": 0, "checkout": 0, "enabl": 0, "configur": 0}, "envversion": {"sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx": 60}, "alltitles": {"Google Analytics extension for Sphinx": [[0, "google-analytics-extension-for-sphinx"]], "About": [[0, "about"]], "Installing from sphinx-contrib checkout": [[0, "installing-from-sphinx-contrib-checkout"]], "Enabling the extension in Sphinx": [[0, "enabling-the-extension-in-sphinx"]], "Configuration": [[0, "configuration"]], "Welcome to SalesGPT\u2019s documentation!": [[1, "welcome-to-salesgpt-s-documentation"]], "Contents:": [[1, null], [3, null]], "Indices and tables": [[1, "indices-and-tables"]], "salesgpt": [[2, "salesgpt"]], "salesgpt package": [[3, "salesgpt-package"]], "Submodules": [[3, "submodules"]], "Module contents": [[3, "module-salesgpt"]], "salesgpt.agents module": [[4, "module-salesgpt.agents"]], "Parameters": [[4, "parameters"], [4, "id1"], [4, "id3"]], "Returns": [[4, "returns"], [4, "id2"], [4, "id4"]], "Raises": [[4, "raises"]], "salesgpt.chains module": [[5, "module-salesgpt.chains"]], "salesgpt.logger module": [[6, "module-salesgpt.logger"]], "salesgpt.parsers module": [[7, "module-salesgpt.parsers"]], "salesgpt.prompts module": [[8, "module-salesgpt.prompts"]], "salesgpt.prompts_cn module": [[9, "module-salesgpt.prompts_cn"]], "salesgpt.salesgptapi module": [[10, "module-salesgpt.salesgptapi"]], "salesgpt.stages module": [[11, "module-salesgpt.stages"]], "salesgpt.templates module": [[12, "module-salesgpt.templates"]], "salesgpt.tools module": [[13, "module-salesgpt.tools"]], "salesgpt.version module": [[14, "module-salesgpt.version"]]}, "indexentries": {"module": [[3, "module-salesgpt"], [4, "module-salesgpt.agents"], [5, "module-salesgpt.chains"], [6, "module-salesgpt.logger"], [7, "module-salesgpt.parsers"], [8, "module-salesgpt.prompts"], [9, "module-salesgpt.prompts_cn"], [10, "module-salesgpt.salesgptapi"], [11, "module-salesgpt.stages"], [12, "module-salesgpt.templates"], [13, "module-salesgpt.tools"], [14, "module-salesgpt.version"]], "salesgpt": [[3, "module-salesgpt"]], "salesgpt (class in salesgpt.agents)": [[4, "salesgpt.agents.SalesGPT"]], "acall() (salesgpt.agents.salesgpt method)": [[4, "salesgpt.agents.SalesGPT.acall"]], "acompletion_with_retry() (salesgpt.agents.salesgpt method)": [[4, "salesgpt.agents.SalesGPT.acompletion_with_retry"]], "adetermine_conversation_stage() (salesgpt.agents.salesgpt method)": [[4, "salesgpt.agents.SalesGPT.adetermine_conversation_stage"]], "astep() (salesgpt.agents.salesgpt method)": [[4, "salesgpt.agents.SalesGPT.astep"]], "company_business (salesgpt.agents.salesgpt attribute)": [[4, "salesgpt.agents.SalesGPT.company_business"]], "company_name (salesgpt.agents.salesgpt attribute)": [[4, "salesgpt.agents.SalesGPT.company_name"]], "company_values (salesgpt.agents.salesgpt attribute)": [[4, "salesgpt.agents.SalesGPT.company_values"]], "conversation_history (salesgpt.agents.salesgpt attribute)": [[4, "salesgpt.agents.SalesGPT.conversation_history"]], "conversation_purpose (salesgpt.agents.salesgpt attribute)": [[4, "salesgpt.agents.SalesGPT.conversation_purpose"]], "conversation_stage_dict (salesgpt.agents.salesgpt attribute)": [[4, "salesgpt.agents.SalesGPT.conversation_stage_dict"]], "conversation_stage_id (salesgpt.agents.salesgpt attribute)": [[4, "salesgpt.agents.SalesGPT.conversation_stage_id"]], "conversation_type (salesgpt.agents.salesgpt attribute)": [[4, "salesgpt.agents.SalesGPT.conversation_type"]], "current_conversation_stage (salesgpt.agents.salesgpt attribute)": [[4, "salesgpt.agents.SalesGPT.current_conversation_stage"]], "determine_conversation_stage() (salesgpt.agents.salesgpt method)": [[4, "salesgpt.agents.SalesGPT.determine_conversation_stage"]], "from_llm() (salesgpt.agents.salesgpt class method)": [[4, "salesgpt.agents.SalesGPT.from_llm"]], "human_step() (salesgpt.agents.salesgpt method)": [[4, "salesgpt.agents.SalesGPT.human_step"]], "input_keys (salesgpt.agents.salesgpt property)": [[4, "salesgpt.agents.SalesGPT.input_keys"]], "knowledge_base (salesgpt.agents.salesgpt attribute)": [[4, "salesgpt.agents.SalesGPT.knowledge_base"]], "model_name (salesgpt.agents.salesgpt attribute)": [[4, "salesgpt.agents.SalesGPT.model_name"]], "output_keys (salesgpt.agents.salesgpt property)": [[4, "salesgpt.agents.SalesGPT.output_keys"]], "retrieve_conversation_stage() (salesgpt.agents.salesgpt method)": [[4, "salesgpt.agents.SalesGPT.retrieve_conversation_stage"]], "sales_agent_executor (salesgpt.agents.salesgpt attribute)": [[4, "salesgpt.agents.SalesGPT.sales_agent_executor"]], "sales_conversation_utterance_chain (salesgpt.agents.salesgpt attribute)": [[4, "salesgpt.agents.SalesGPT.sales_conversation_utterance_chain"]], "salesgpt.agents": [[4, "module-salesgpt.agents"]], "salesperson_name (salesgpt.agents.salesgpt attribute)": [[4, "salesgpt.agents.SalesGPT.salesperson_name"]], "salesperson_role (salesgpt.agents.salesgpt attribute)": [[4, "salesgpt.agents.SalesGPT.salesperson_role"]], "seed_agent() (salesgpt.agents.salesgpt method)": [[4, "salesgpt.agents.SalesGPT.seed_agent"]], "stage_analyzer_chain (salesgpt.agents.salesgpt attribute)": [[4, "salesgpt.agents.SalesGPT.stage_analyzer_chain"]], "step() (salesgpt.agents.salesgpt method)": [[4, "salesgpt.agents.SalesGPT.step"]], "use_tools (salesgpt.agents.salesgpt attribute)": [[4, "salesgpt.agents.SalesGPT.use_tools"]], "salesconversationchain (class in salesgpt.chains)": [[5, "salesgpt.chains.SalesConversationChain"]], "stageanalyzerchain (class in salesgpt.chains)": [[5, "salesgpt.chains.StageAnalyzerChain"]], "from_llm() (salesgpt.chains.salesconversationchain class method)": [[5, "salesgpt.chains.SalesConversationChain.from_llm"]], "from_llm() (salesgpt.chains.stageanalyzerchain class method)": [[5, "salesgpt.chains.StageAnalyzerChain.from_llm"]], "salesgpt.chains": [[5, "module-salesgpt.chains"]], "timefilter (class in salesgpt.logger)": [[6, "salesgpt.logger.TimeFilter"]], "filter() (salesgpt.logger.timefilter method)": [[6, "salesgpt.logger.TimeFilter.filter"]], "salesgpt.logger": [[6, "module-salesgpt.logger"]], "time_logger() (in module salesgpt.logger)": [[6, "salesgpt.logger.time_logger"]], "salesconvooutputparser (class in salesgpt.parsers)": [[7, "salesgpt.parsers.SalesConvoOutputParser"]], "ai_prefix (salesgpt.parsers.salesconvooutputparser attribute)": [[7, "salesgpt.parsers.SalesConvoOutputParser.ai_prefix"]], "get_format_instructions() (salesgpt.parsers.salesconvooutputparser method)": [[7, "salesgpt.parsers.SalesConvoOutputParser.get_format_instructions"]], "parse() (salesgpt.parsers.salesconvooutputparser method)": [[7, "salesgpt.parsers.SalesConvoOutputParser.parse"]], "salesgpt.parsers": [[7, "module-salesgpt.parsers"]], "verbose (salesgpt.parsers.salesconvooutputparser attribute)": [[7, "salesgpt.parsers.SalesConvoOutputParser.verbose"]], "salesgpt.prompts": [[8, "module-salesgpt.prompts"]], "salesgpt.prompts_cn": [[9, "module-salesgpt.prompts_cn"]], "salesgptapi (class in salesgpt.salesgptapi)": [[10, "salesgpt.salesgptapi.SalesGPTAPI"]], "do() (salesgpt.salesgptapi.salesgptapi method)": [[10, "salesgpt.salesgptapi.SalesGPTAPI.do"]], "do_stream() (salesgpt.salesgptapi.salesgptapi method)": [[10, "salesgpt.salesgptapi.SalesGPTAPI.do_stream"]], "initialize_agent() (salesgpt.salesgptapi.salesgptapi method)": [[10, "salesgpt.salesgptapi.SalesGPTAPI.initialize_agent"]], "salesgpt.salesgptapi": [[10, "module-salesgpt.salesgptapi"]], "salesgpt.stages": [[11, "module-salesgpt.stages"]], "customprompttemplatefortools (class in salesgpt.templates)": [[12, "salesgpt.templates.CustomPromptTemplateForTools"]], "format() (salesgpt.templates.customprompttemplatefortools method)": [[12, "salesgpt.templates.CustomPromptTemplateForTools.format"]], "salesgpt.templates": [[12, "module-salesgpt.templates"]], "template (salesgpt.templates.customprompttemplatefortools attribute)": [[12, "salesgpt.templates.CustomPromptTemplateForTools.template"]], "tools_getter (salesgpt.templates.customprompttemplatefortools attribute)": [[12, "salesgpt.templates.CustomPromptTemplateForTools.tools_getter"]], "completion_bedrock() (in module salesgpt.tools)": [[13, "salesgpt.tools.completion_bedrock"]], "generate_calendly_invitation_link() (in module salesgpt.tools)": [[13, "salesgpt.tools.generate_calendly_invitation_link"]], "generate_stripe_payment_link() (in module salesgpt.tools)": [[13, "salesgpt.tools.generate_stripe_payment_link"]], "get_mail_body_subject_from_query() (in module salesgpt.tools)": [[13, "salesgpt.tools.get_mail_body_subject_from_query"]], "get_product_id_from_query() (in module salesgpt.tools)": [[13, "salesgpt.tools.get_product_id_from_query"]], "get_tools() (in module salesgpt.tools)": [[13, "salesgpt.tools.get_tools"]], "salesgpt.tools": [[13, "module-salesgpt.tools"]], "send_email_tool() (in module salesgpt.tools)": [[13, "salesgpt.tools.send_email_tool"]], "send_email_with_gmail() (in module salesgpt.tools)": [[13, "salesgpt.tools.send_email_with_gmail"]], "setup_knowledge_base() (in module salesgpt.tools)": [[13, "salesgpt.tools.setup_knowledge_base"]], "salesgpt.version": [[14, "module-salesgpt.version"]]}}) \ No newline at end of file diff --git a/api-website/_static/google_analytics_tracker.js b/api-website/_static/google_analytics_tracker.js new file mode 100644 index 00000000..11381ec4 --- /dev/null +++ b/api-website/_static/google_analytics_tracker.js @@ -0,0 +1,4 @@ +window.dataLayer = window.dataLayer || []; +function gtag(){dataLayer.push(arguments);} +gtag('js', new Date()); +gtag('config', 'GTM-NX3SZD79'); \ No newline at end of file diff --git a/api-website/_templates/layout.html b/api-website/_templates/layout.html index d4682304..5b00805c 100644 --- a/api-website/_templates/layout.html +++ b/api-website/_templates/layout.html @@ -255,4 +255,4 @@ {%- block footer %} {% endblock %} - + \ No newline at end of file diff --git a/api-website/conf.py b/api-website/conf.py index e70b4c4c..f840dc61 100644 --- a/api-website/conf.py +++ b/api-website/conf.py @@ -12,31 +12,36 @@ # import os import sys - -sys.path.insert(0, os.path.abspath("..")) # Source path +sys.path.insert(0, os.path.abspath('..')) #Source path # -- Project information ----------------------------------------------------- -project = "SalesGPT" -copyright = "2024, Filip-Michalsky" -author = "Filip-Michalsky" +project = 'SalesGPT' +copyright = '2024, Filip-Michalsky' +author = 'Filip-Michalsky' +import os +googleanalytics_id = os.getenv('googleanalytics_id') # -- General configuration --------------------------------------------------- # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. -extensions = ["sphinx.ext.autodoc"] +extensions = ['sphinx.ext.autodoc', + 'sphinxcontrib.googleanalytics' +] + + # Add any paths that contain templates here, relative to this directory. -templates_path = ["_templates"] +templates_path = ['_templates'] # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This pattern also affects html_static_path and html_extra_path. -exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] # -- Options for HTML output ------------------------------------------------- @@ -44,12 +49,12 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -html_theme = "sphinx_rtd_theme" +html_theme = 'sphinx_rtd_theme' # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static"] +html_static_path = ['_static'] html_css_files = [ - "custom.css", # add your custom CSS file here + 'custom.css', # add your custom CSS file here ] diff --git a/api-website/googleanalytics b/api-website/googleanalytics new file mode 160000 index 00000000..d4c6801e --- /dev/null +++ b/api-website/googleanalytics @@ -0,0 +1 @@ +Subproject commit d4c6801e0529af6e366e9961ce62b65a51fe7353 diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 7ccd3d71..66a76094 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -27,6 +27,7 @@ "@types/react-dom": "^18", "@types/uuid": "^9.0.8", "autoprefixer": "^10.0.1", + "dotenv-cli": "^7.4.1", "eslint": "^8", "eslint-config-next": "14.1.0", "nodemon": "^3.1.0", @@ -1510,6 +1511,42 @@ "node": ">=6.0.0" } }, + "node_modules/dotenv": { + "version": "16.4.5", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", + "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "node_modules/dotenv-cli": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/dotenv-cli/-/dotenv-cli-7.4.1.tgz", + "integrity": "sha512-fE1aywjRrWGxV3miaiUr3d2zC/VAiuzEGghi+QzgIA9fEf/M5hLMaRSXb4IxbUAwGmaLi0IozdZddnVU96acag==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "dotenv": "^16.3.0", + "dotenv-expand": "^10.0.0", + "minimist": "^1.2.6" + }, + "bin": { + "dotenv": "cli.js" + } + }, + "node_modules/dotenv-expand": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/dotenv-expand/-/dotenv-expand-10.0.0.tgz", + "integrity": "sha512-GopVGCpVS1UKH75VKHGuQFqS1Gusej0z4FyQkPdwjil2gNIv+LNsqBlboOzpJFZKVT95GkCyWJbBSdFEFUWI2A==", + "dev": true, + "engines": { + "node": ">=12" + } + }, "node_modules/eastasianwidth": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", diff --git a/frontend/package.json b/frontend/package.json index 18f8e0fb..fde1b1f8 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -3,7 +3,7 @@ "version": "0.1.0", "private": true, "scripts": { - "dev": "nodemon --watch pages --watch components --exec \"next dev\"", + "dev": "./start-dev.sh", "build": "next build", "start": "next start", "lint": "next lint" diff --git a/frontend/src/components/chat-interface.tsx b/frontend/src/components/chat-interface.tsx index 4c6e73f3..551ad649 100644 --- a/frontend/src/components/chat-interface.tsx +++ b/frontend/src/components/chat-interface.tsx @@ -9,13 +9,16 @@ import rehypeRaw from 'rehype-raw'; import { PostHog } from 'posthog-node' -const client = new PostHog( - `${process.env.NEXT_PUBLIC_POSTHOG_ID}`, - { host: 'https://app.posthog.com', - disableGeoip: false, - requestTimeout: 30000 - } -) +let client: PostHog | undefined; +if (process.env.ENVIRONMENT === "production") { + client = new PostHog( + `${process.env.NEXT_PUBLIC_POSTHOG_ID}`, + { host: 'https://app.posthog.com', + disableGeoip: false, + requestTimeout: 30000 + } + ); +} type Message = { id: string; @@ -88,28 +91,37 @@ export function ChatInterface() { useEffect(() => { // Function to fetch the bot name const fetchBotName = async () => { - // console.log("REACT_APP_API_URL:", process.env.NEXT_PUBLIC_API_URL); // Added console logging for debugging - client.capture({ - distinctId: session_id, - event: 'fetched-bot-name', - properties: { - $current_url: window.location.href, - }, - }) + if (process.env.ENVIRONMENT === "production" && client) { + client.capture({ + distinctId: session_id, + event: 'fetched-bot-name', + properties: { + $current_url: window.location.href, + }, + }); + } + try { + const headers: Record = { + 'Content-Type': 'application/json' + }; + + if (process.env.ENVIRONMENT === "production") { + headers['Authorization'] = `Bearer ${process.env.NEXT_PUBLIC_AUTH_KEY}`; + } + const response = await fetch(`${process.env.NEXT_PUBLIC_API_URL}/botname`, { - method: 'GET', // Method is optional since GET is the default value - headers: { - 'Authorization': `Bearer ${process.env.NEXT_PUBLIC_AUTH_KEY}` - }, + method: 'GET', + headers: headers, }); + if (!response.ok) { throw new Error(`Network response was not ok: ${response.statusText}`); } - + const data = await response.json(); setBotName(data.name); // Save the bot name in the state - console.log(botName) + console.log(botName); } catch (error) { console.error("Failed to fetch the bot's name:", error); } @@ -133,13 +145,16 @@ export function ChatInterface() { }; const handleBotResponse = async (userMessage: string) => { - client.capture({ - distinctId: session_id, - event: 'sent-message', - properties: { - $current_url: window.location.href, - }, - }) + if (process.env.ENVIRONMENT === "production" && client) { + client.capture({ + distinctId: session_id, + event: 'sent-message', + properties: { + $current_url: window.location.href, + }, + }); + } + const requestData = { session_id, human_say: userMessage, @@ -148,12 +163,17 @@ export function ChatInterface() { setIsBotTyping(true); // Start showing the typing indicator try { + const headers: Record = { + 'Content-Type': 'application/json' + }; + + if (process.env.ENVIRONMENT === "production") { + headers['Authorization'] = `Bearer ${process.env.NEXT_PUBLIC_AUTH_KEY}`; + } + const response = await fetch(`${process.env.NEXT_PUBLIC_API_URL}/chat`, { method: 'POST', - headers: { - 'Content-Type': 'application/json', - 'Authorization': `Bearer ${process.env.NEXT_PUBLIC_AUTH_KEY}` - }, + headers: headers, body: JSON.stringify(requestData), }); @@ -164,30 +184,29 @@ export function ChatInterface() { if (stream) { {/*Not implemented*/} } else { - if (!stream) { - const data = await response.json(); - console.log('Bot response:', data); - setBotName(data.bot_name); // Update bot name based on response - setConversationalStage(data.conversational_stage); - // Update the thinkingProcess state with new fields from the response - setThinkingProcess(prevProcess => [...prevProcess, { - conversationalStage: data.conversational_stage, - tool: data.tool, - toolInput: data.tool_input, - actionOutput: data.action_output, - actionInput: data.action_input - }]); - const botMessageText = `${data.response}`; - const botMessage: Message = { id: uuidv4(), text: botMessageText, sender: 'bot' }; - setBotMessageIndex(botMessageIndex + 1); - setMessages((prevMessages) => [...prevMessages, botMessage]); - }} - } catch (error) { - console.error("Failed to fetch bot's response:", error); - } finally { - setIsBotTyping(false); // Stop showing the typing indicator - setBotHasResponded(true); + const data = await response.json(); + console.log('Bot response:', data); + setBotName(data.bot_name); // Update bot name based on response + setConversationalStage(data.conversational_stage); + // Update the thinkingProcess state with new fields from the response + setThinkingProcess(prevProcess => [...prevProcess, { + conversationalStage: data.conversational_stage, + tool: data.tool, + toolInput: data.tool_input, + actionOutput: data.action_output, + actionInput: data.action_input + }]); + const botMessageText = `${data.response}`; + const botMessage: Message = { id: uuidv4(), text: botMessageText, sender: 'bot' }; + setBotMessageIndex(botMessageIndex + 1); + setMessages((prevMessages) => [...prevMessages, botMessage]); } + } catch (error) { + console.error("Failed to fetch bot's response:", error); + } finally { + setIsBotTyping(false); // Stop showing the typing indicator + setBotHasResponded(true); + } }; return (
        @@ -299,4 +318,3 @@ export function ChatInterface() {
        ); } - diff --git a/frontend/start-dev.sh b/frontend/start-dev.sh new file mode 100755 index 00000000..00618926 --- /dev/null +++ b/frontend/start-dev.sh @@ -0,0 +1,3 @@ +#!/bin/bash +export $(grep -v '^#' ../.env | xargs) +nodemon --watch pages --watch components --exec "next dev" diff --git a/run_api.py b/run_api.py index 33988d31..1e6039ac 100644 --- a/run_api.py +++ b/run_api.py @@ -1,10 +1,10 @@ import json import os -from typing import List +from typing import List, Optional import uvicorn from dotenv import load_dotenv -from fastapi import FastAPI, Query +from fastapi import FastAPI, Query, Header, HTTPException, Depends from fastapi.middleware.cors import CORSMiddleware from fastapi.responses import StreamingResponse from pydantic import BaseModel @@ -34,8 +34,6 @@ allow_headers=["*"], ) -from fastapi import Header, HTTPException, Depends - class AuthenticatedResponse(BaseModel): message: str @@ -61,9 +59,11 @@ class MessageList(BaseModel): @app.get("/botname", response_model=None) -async def get_bot_name(authorization: str = Header(...)): +async def get_bot_name(authorization: Optional[str] = Header(None)): load_dotenv() - get_auth_key(authorization) + if os.getenv("ENVIRONMENT") == "production": + get_auth_key(authorization) + sales_api = SalesGPTAPI( config_path=os.getenv("CONFIG_PATH", "examples/example_agent_setup.json"), product_catalog=os.getenv( @@ -77,7 +77,7 @@ async def get_bot_name(authorization: str = Header(...)): @app.post("/chat") -async def chat_with_sales_agent(req: MessageList, stream: bool = Query(False), authorization: str = Header(...)): +async def chat_with_sales_agent(req: MessageList, stream: bool = Query(False), authorization: Optional[str] = Header(None)): """ Handles chat interactions with the sales agent. @@ -94,7 +94,8 @@ async def chat_with_sales_agent(req: MessageList, stream: bool = Query(False), a Streaming functionality is planned but not yet available. The current implementation only supports synchronous responses. """ sales_api = None - get_auth_key(authorization) + if os.getenv("ENVIRONMENT") == "production": + get_auth_key(authorization) # print(f"Received request: {req}") if req.session_id in sessions: print("Session is found!") diff --git a/website/README.md b/website/README.md deleted file mode 100644 index 0c6c2c27..00000000 --- a/website/README.md +++ /dev/null @@ -1,41 +0,0 @@ -# Website - -This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator. - -### Installation - -``` -$ yarn -``` - -### Local Development - -``` -$ yarn start -``` - -This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. - -### Build - -``` -$ yarn build -``` - -This command generates static content into the `build` directory and can be served using any static contents hosting service. - -### Deployment - -Using SSH: - -``` -$ USE_SSH=true yarn deploy -``` - -Not using SSH: - -``` -$ GIT_USER= yarn deploy -``` - -If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch. diff --git a/website/docs/Basics/Installation.md b/website/docs/Basics/Installation.md index 4bc5ae46..d183d3ec 100644 --- a/website/docs/Basics/Installation.md +++ b/website/docs/Basics/Installation.md @@ -2,7 +2,6 @@ sidebar_position: 2 --- - # Setup ## Install diff --git a/website/docs/Basics/Introduction.mdx b/website/docs/Basics/Introduction.mdx index b79bb85e..f45713c0 100644 --- a/website/docs/Basics/Introduction.mdx +++ b/website/docs/Basics/Introduction.mdx @@ -3,6 +3,8 @@ sidebar_position: 1 slug: / --- + + # Introduction
        diff --git a/website/docs/Basics/Quickstart.md b/website/docs/Basics/Quickstart.md index 34ce6c8d..cdf15c94 100644 --- a/website/docs/Basics/Quickstart.md +++ b/website/docs/Basics/Quickstart.md @@ -3,6 +3,7 @@ sidebar_position: 2 --- + # Deployment Guide ## Run an Example AI Sales agent diff --git a/website/docs/Contribute/_category_.json b/website/docs/Contribute/_category_.json index b84cbc58..c684fc34 100644 --- a/website/docs/Contribute/_category_.json +++ b/website/docs/Contribute/_category_.json @@ -1,6 +1,6 @@ { "label": "Contribute", - "position": 3, + "position": 4, "link": { "type": "generated-index", "description": "About the team and how to contribute to the project", diff --git a/website/docs/Tools/Product_catalog.md b/website/docs/Tools/Product_catalog.md new file mode 100644 index 00000000..e95a8b52 --- /dev/null +++ b/website/docs/Tools/Product_catalog.md @@ -0,0 +1,9 @@ +--- +sidebar_position: 1 + +--- + +# Product search catalog + +You can implement your product catalog into SalesGPT by loading it. + diff --git a/website/docs/Tools/_category_.json b/website/docs/Tools/_category_.json new file mode 100644 index 00000000..98196e05 --- /dev/null +++ b/website/docs/Tools/_category_.json @@ -0,0 +1,8 @@ +{ + "label": "Tools", + "position": 3, + "link": { + "type": "generated-index", + "description": "3 min to save the world" + } +} diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index ddb237f1..403b67c4 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -4,6 +4,13 @@ // There are various equivalent ways to declare your Docusaurus config. // See: https://docusaurus.io/docs/api/docusaurus-config +// Removed dotenv require and config as it's causing module not found error +// const dotenv = require('dotenv'); +// dotenv.config({ path: '../.env' }); + +const GTAG_DOC = process.env.GTAG_DOC; +const GTMAN_DOC = process.env.GTMAN_DOC; + import {themes as prismThemes} from 'prism-react-renderer'; /** @type {import('@docusaurus/types').Config} */ @@ -58,6 +65,13 @@ const config = { theme: { customCss: './src/css/custom.css', }, + gtag: { + trackingID: GTAG_DOC, + anonymizeIP: true, + }, + googleTagManager: { + containerId: GTMAN_DOC, + }, }), ], ], @@ -143,3 +157,4 @@ const config = { }; export default config; +