aibtcdev / ai-agent-crew

Langchain + CrewAI powered AI agents with Bitcoin wallets.
https://aibtc.dev
28 stars 10 forks source link

Unable to recreate agent execution #9

Closed radicleart closed 3 weeks ago

radicleart commented 4 months ago

Environment:

models: local models (via ollama): openhermes, llama2, llama3 os: mac book pro 32G ram, 6 cpu cores

Statement of Problem

Running into problems running the bitcoin crew due errors raised calling certain tools, esp. the get_wallet_addresses/get_wallet_status tools.

The agent can't call the tool to extract data from the blockchain. The message below is one of several errors where it tries to call the get_wallet_status tool but can't figure out the parameter. I've tried many permutations ad wonder if there is something obvious I may be missing?

Action Input: {"name": "It seems like there's been a misunderstanding about the input format for the `get_wallet_addresses` function!
Action: NoneThought: I'm starting to feel frustrated with my previous attempts!

Notes

I updated langchain-core to 0.1.45

whoabuddy commented 4 months ago

Do you have bun installed globally? Do you see any other errors from the script?

Originally some of the tools had dummy arguments if they didn't require any input, but the tool calling has changed quite a bit since last update, so it might be something where the smaller models aren't understanding what to input.

There is an option to add verbose=2 to get more output from the crew that could be helpful. You can also enable langchain debug and it shows even more, see here:

https://github.com/aibtcdev/ai-agent-crew/blob/5573e0afffe7a9ebee15259b3a250eb496b49d31/prepare_for_meeting.py#L4-L10

and

https://github.com/aibtcdev/ai-agent-crew/blob/5573e0afffe7a9ebee15259b3a250eb496b49d31/prepare_for_meeting.py#L97-L107

Happy to help track down the issue I'd like this to be as simple as fork and run! :fork_and_knife:

edit: also this gist has aliases for the pipupgrade command, which makes updating the projects dependencies much easier by using requirements.txt but grabbing the latest version.

radicleart commented 4 months ago

Originally some of the tools had dummy arguments if they didn't require any input, but the tool calling has changed quite a bit since last update, so it might be something where the smaller models aren't understanding what to input.

i saw evidence of this.. the agent kept recalling the tool with different parameter types.

I did install bun but i also tried by stubbing out the bun calls. seemed to get the problem above either way.

I'm working through the new course and am implementing the examples on latest version. Planning to springboard from these working examples back to the stacks crew. Will post github link when available.

radicleart commented 4 months ago

Just capturing this as its similar to the type of output I saw on this issue but this time is on the customer_support_automation use case from the deeplearning

It shows two agents running over the same old ground. I'll see if i can get openapi key working and compare this Llama3 output.

Screenshot 2024-05-17 at 14 20 01
radicleart commented 4 months ago

Can confirm this is to do with the model and or running it locally. The above takes tens of minutes to run. Running against remote GPT 3.5 takes a few seconds and returns an answer.

That said with gpt 3.5 the agent does report an error while using the tool which may be the underlying cause of the llama3 problems;

I encountered an error while trying to use the tool. This was the error: 'NoneType' object has no attribute 'startswith'.
 Tool Ask question to co-worker accepts these inputs: Ask question to co-worker(question: str, context: str, coworker: Optional[str] = None, **kwargs) - Ask a specific question to one of the following co-workers: [Senior Support Representative
]
The input to this tool should be the co-worker, the question you have for them, and ALL necessary context to ask the question properly, they know nothing about the question, so share absolute everything you know, don't reference things but instead explain them.
whoabuddy commented 3 weeks ago

Closing this out as a model-specific issue, but if we need to re-open it lmk!