filip-michalsky/SalesGPT

use_tools: bool = True problem with actions

devopssii opened this issue · 11 comments

I am facing an implementation issue from your repository. I don't understand how it should work. If you leave use_tools: bool = False in agents.py, then this is just a chat with LLM that hallucinates due to prompts and does not use the product database, it just invents a trading conversation without connecting to a file with real product data. If you set use_tools: bool = True, then it immediately sends the first welcome message to the request, which is naturally not contained in the product database, and a negative response comes from parsers.py line 31 "output": "I apologize, I was unable to find the answer to your question. Is there anything else I can help with?". How do you solve this problem?

Finished chain.
Ted Lasso: Fantastic! The Luxury Cloud-Comfort Memory Foam Mattress is available in different sizes, ranging from Twin to California King. The price varies depending on the size you choose. For example, the Queen size is priced at $1,499. This mattress is designed to provide a luxurious and cloud-like sleep experience, with its premium memory foam layers and exceptional support. It's definitely a great choice for achieving a better night's sleep. Is there anything else you would like to know about this mattress?
salesgpt.logger 2023-07-31 17:25:47,710 - INFO - Running step: --- 4.344321250915527 seconds ---
Your response: -----in your pure version, too, hallucinations on non-existent goods. with use_tools: bool = True in agents.py: error Traceback (most recent call last):
File "/home/marketing_rzk/SalesGPT/run.py", line 61, in
sales_agent.step()
File "/home/marketing_rzk/SalesGPT/salesgpt/logger.py", line 34, in wrapper
result = func(*args, **kwargs) # Function execution
File "/home/marketing_rzk/SalesGPT/salesgpt/agents.py", line 93, in step
self._call(inputs={})
File "/home/marketing_rzk/SalesGPT/salesgpt/agents.py", line 152, in _call
ai_message = self.sales_agent_executor.run(
AttributeError: 'NoneType' object has no attribute 'run'
root@instance-2:/home/marketing_rzk/SalesGPT#

if use_tools: bool = False in agents.py and "USE_TOOLS": "True" in json config :
Another option is the Sleep Haven Supreme. This model is made with high-density foam and has a plush pillow top for added comfort. The Supreme is available in queen and king sizes. The prices for the Supreme range from $1200 for a queen size to $2000 for a king size.

Please let me know if you would like more information on any specific model or if you have any other questions. <END_OF_TURN>
User: Luxury Cloud-Comfort Memory Foam Mattress price on Twin <END_OF_TURN>
Ted Lasso:

Finished chain.
Ted Lasso: I apologize, but we do not have a model called the Luxury Cloud-Comfort Memory Foam Mattress. However, we do have other models available that may meet your needs. Would you like me to provide more information on those?
salesgpt.logger 2023-07-31 17:46:29,479 - INFO - Running step: --- 2.1961207389831543 seconds ---
Your response: - hallucinations on non-existent goods.

if use_tools: bool = False in agents.py and "use_tools": true in json config :

Traceback (most recent call last):
File "/home/marketing_rzk/SalesGPT/run.py", line 50, in
sales_agent = SalesGPT.from_llm(llm, verbose=verbose, **config)
File "/home/marketing_rzk/SalesGPT/salesgpt/logger.py", line 34, in wrapper
result = func(*args, **kwargs) # Function execution
File "/home/marketing_rzk/SalesGPT/salesgpt/agents.py", line 218, in from_llm
product_catalog = kwargs["product_catalog"]
KeyError: 'product_catalog'
root@instance-2:/home/marketing_rzk/SalesGPT#

@devopssii related bug/issue to this issue

@devopssii what LLM are you using? did you change the base prompt? Smaller LLM models might not be expressive enough yet to keep the required structure of generated output for successful parsing. This needs a solution but we are dealing with a stochastic ginny.

https://github.com/filip-michalsky/SalesGPT/blob/main/salesgpt/parsers.py#L28

  • we also need a consistency check on tool usage.

gpt-3.5-turbo. if use_tools false defaut agent must use tool with description jr not? because you def from_llm is static and not work dynamic

whatever parsers is not working

I faced the same problem, till this moment I have one line of code related to this problem at agents.py line 297.
The line looks for a str "True", while the recommended (and expected by anyone) is that you pass the arg use_tools=True (boolean True), and the line 297 of agents.py looks for a "True" in kwargs['use_tools'].
The line:
if "use_tools" in kwargs.keys() and kwargs["use_tools"] == "True": ...
What I suppose the line should be:
if "use_tools" in kwargs.keys() and kwargs["use_tools"] == True: ...
While the bug is not fixed, you can pass use_tools='True'.

@Demian143 thanks for your input, actually it’s not expected by everyone to be boolean. when you use JSON agent config (per the example), the field gets read in as a string. Can you please help by submitting a PR to allow and effectively handle both in-code and JSON config input? I will get to it when I can but help would be appreciated. Thanks

Sure, I'll try to fix it.

Could you please send me an example case or reference of using a JSON agent config?

Please see the readme:

python run.py --verbose True --config examples/example_agent_setup.json

thanks