AshAI tool calling: framework does not automatically run the tool?
I'm working through my first tool calling experience in a LiveBook as a learning exercise.
AshAI is adding a %LangChain.Function{} to the chain's tools list, and the LLM responds with :assistant role Message containing the %LangChain.Message.ToolCall{} 🎉
I suppose I expected the magic to continue, that the framework would intercept that ToolCall, automatically run the tool, and then respond with a :tool result message to continue the chain.
I know I can write the logic myself to do all that, but I'm here to ask a) did I miss something and this can actually happen or b) what are the considerations that would make this impossible as a feature request?
7 Replies
That is how it's supposed to work.
What does your code look like?
Excited that I will have less code to write once I know how 😉
I can't actually open that on my phone 😂
No apps to open livemd files
Can I just see the snippet where you're invoking langchain?
I think you just need the "while needs response" logic
I forget the function. If you run Ash AI's chat generator you can see an example
I'll run the generator again, been a couple of weeks and I missed the example in the generated code.
Solution
Yeah, LLMChain.run takes a
mode
optionTake a look at the langchain docs for it
Got it. Thanks for pointing the way. For others: