AutoGPT icon indicating copy to clipboard operation
AutoGPT copied to clipboard

Fails: NEXT ACTION: COMMAND = Error: ARGUMENTS = 'dict' object has no attribute 'replace'

Open Mereep opened this issue 2 years ago • 9 comments

Duplicates

  • [X] I have searched the existing issues

Steps to reproduce 🕹

System: MacOS (intel) Python 3.10 Branch: master and stable When: Initial try

Current behavior 😯

Problem: Tried on a freshly checkout project. Told it to be a research API. However, it outputs the json is corrupted and it tries to repair it. Which fails sometimes and sometimes not. However the prompt always ends with

NEXT ACTION: COMMAND = Error: ARGUMENTS = 'dict' object has no attribute 'replace'

as in follow:

A common method for achieving this is through the use of SNARKs, Succinct Non-Interactive Arguments of Knowledge. 

These approaches can help to greatly reduce the amount of data required to be transmitted over the untrusted medium, as only the final result of the transaction is transmitted over the untrusted medium.
\```
  -----------
  Fixed JSON: I'm sorry, but I'm not sure what you are asking for. Can you please provide more context or clarify your question?
  ----------- END OF FIX ATTEMPT ----------------
Failed to fix AI output, telling the AI.  
Error: Invalid JSON
  Understood! To verify state without actually accessing the blockchain, you would have to rely on external components. One possible solution is to use an Oracle. 

An Oracle is a trusted third party that collects information from the outside world and sends it on the blockchain. It can be viewed as a middleman in the communication and carry out the transaction based on the state of the information.

Another approach will be to use Zero-Knowledge Proofs, ZKPs. 
ZKP allows a user to prove knowledge of a statement or value, without actually revealing the statement or the value. 
A common method for achieving this is through the use of SNARKs, Succinct Non-Interactive Arguments of Knowledge. 

These approaches can help to greatly reduce the amount of data required to be transmitted over the untrusted medium, as only the final result of the transaction is transmitted over the untrusted medium.
Attempting to fix JSON by finding outermost brackets 
Error: Invalid JSON, setting it to empty JSON now.
  
RESEARCHER API THOUGHTS: 
REASONING: 
CRITICISM: 
Attempting to fix JSON by finding outermost brackets 
Error: Invalid JSON, setting it to empty JSON now.
  
NEXT ACTION:  COMMAND = Error: ARGUMENTS = 'dict' object has no attribute 'replace'

Hint the \``` was escaped on purpose (it is in the original output)

Expected behavior 🤔

Not raise ;)

Your prompt 📝

# Paste your prompt here

Dont have that file being created

Mereep avatar Apr 14 '23 14:04 Mereep

Can add Information: This happens whenever ChatGPT is not returning a JSON-like response like How may I assist you today? Can you provide me with a task or specific problem to solve?.

Mereep avatar Apr 14 '23 15:04 Mereep

I'm having the same issue on a freshly installed copy of stable and master. Also getting "Error: Invalid JSON, setting it to empty JSON now." I've tried making a auto-gpt.json file with brackets inside {}.

NCLDev avatar Apr 14 '23 20:04 NCLDev

same as @NCLDev

brucruz avatar Apr 14 '23 22:04 brucruz

I'm having the same issue on a freshly installed copy of stable and master. Also getting "Error: Invalid JSON, setting it to empty JSON now." I've tried making a auto-gpt.json file with brackets inside {}.

same issue here as well

utribedi avatar Apr 14 '23 23:04 utribedi

me too. How to fix it?

Windy-Ground avatar Apr 15 '23 02:04 Windy-Ground

same here.

mehran9 avatar Apr 15 '23 11:04 mehran9

same here

Jun10ng avatar Apr 15 '23 15:04 Jun10ng

I'm having the same issue on a freshly installed copy of stable and master. Also getting "Error: Invalid JSON, setting it to empty JSON now." I've tried making a auto-gpt.json file with brackets inside {}.

By the way it seems like restarting autogpt with a auto-gpt.json file with just brackets {} will fix this for a while but whenever I tell autogpt something the problem seems to reoccur the most as opposed to just typing y or hitting enter.

NCLDev avatar Apr 15 '23 16:04 NCLDev

No, just restarting it works. but after a while it also crashes...

BenGost avatar Apr 15 '23 16:04 BenGost

Same here!

jimsrc avatar Apr 15 '23 22:04 jimsrc

Is this related to the jsons being saved in 'auto_gpt_workspace'? My json files in there just get a text description of what json should follow but there's no json.

birchcode avatar Apr 16 '23 03:04 birchcode

Same here. Issue persists after a fresh install and is a common issue over the last couple days. Anyone find a fix yet?

evanmcfarland avatar Apr 16 '23 21:04 evanmcfarland

getting this alot also, running native windows, not mac OS or docker

evmond1 avatar Apr 17 '23 07:04 evmond1

I've found that this usually happens when using --gpt3only. I guess it's because GPT tends to give less importance to using the JSON format (and the available commands) when the accumulated conversations get big. I guess that makes GPT to pay more attention to what was said in the more recent interactions.

I mean, the problem here is that GPT is not replying in the JSON format that it was instructed to.

To "patch" this behavior, I've seen that adding "\nReply with the JSON format specified above, and properly use one of the available commands above." to the self.user_input helps a lot. It should to added within the start_interaction_loop() method of the Agent class, just after the with Spinner("Thinking... ") statement.

jimsrc avatar Apr 18 '23 21:04 jimsrc

This issue has automatically been marked as stale because it has not had any activity in the last 50 days. You can unstale it by commenting or removing the label. Otherwise, this issue will be closed in 10 days.

github-actions[bot] avatar Sep 06 '23 21:09 github-actions[bot]

This issue was closed automatically because it has been stale for 10 days with no activity.

github-actions[bot] avatar Sep 19 '23 01:09 github-actions[bot]