Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use_tools: bool = True problem with actions #25

Closed
devopssii opened this issue Jul 31, 2023 · 11 comments
Closed

use_tools: bool = True problem with actions #25

devopssii opened this issue Jul 31, 2023 · 11 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@devopssii
Copy link

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?

@devopssii
Copy link
Author

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#

@filip-michalsky filip-michalsky added bug Something isn't working help wanted Extra attention is needed labels Aug 2, 2023
@filip-michalsky
Copy link
Owner

@devopssii related bug/issue to this issue

@filip-michalsky
Copy link
Owner

@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.

@devopssii
Copy link
Author

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

@devopssii
Copy link
Author

whatever parsers is not working

@Demian143
Copy link
Contributor

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'.

@filip-michalsky
Copy link
Owner

@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

@Demian143
Copy link
Contributor

Sure, I'll try to fix it.

@Demian143
Copy link
Contributor

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

@filip-michalsky
Copy link
Owner

Please see the readme:

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

@Demian143
Copy link
Contributor

thanks

@Demian143 Demian143 mentioned this issue Sep 4, 2023
filip-michalsky added a commit that referenced this issue Sep 6, 2023
Fix #25 - pass `use_tools` as either arg or a string from loaded JSON config.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants