PrefectHQ / marvin

✨ Build AI interfaces that spark joy
https://askmarvin.ai
Apache License 2.0
5.1k stars 326 forks source link

Allow local function calling? #889

Open jeffometer opened 4 months ago

jeffometer commented 4 months ago

First check

Describe the current behavior

Hello, I really like Marvin, especially the AI functions, but I have a need that it doesn't do (from all the docs that I've seen) and I am curious if it is on the roadmap or not. Specifically, I would like local function calling.

Describe the proposed behavior

I've been using Fructose in the mean time because they are essentially the same as the Marvin ai functions, but they also support local function calling which let's me augment my LLM calls in the same clean interface that brought me to Marvin/Fructose in the first place.

Example Use

See https://github.com/bananaml/fructose?tab=readme-ov-file#local-function-calling

Additional context

Ultimately I'd like to know if this is on the roadmap or considered "in scope" for Marvin. If so, I'm hoping to see how it could be prioritized. Thank you!

jeffometer commented 4 months ago

BTW, I am aware of the returned values feature, but as far as I can tell, that is different in that it doesn't allow the LLM to choose between multiple "tools" and also decide on the correct arguments to pass.

zzstoatzz commented 4 months ago

hi @jeffometer - to clarify, by

local function calling

you mean an LLM calls a python function you wrote when appropriate? easiest way to do that is with assistants

image

here's a more complex example where we have many (10-15) tools to have it choose from

is that what you're looking for?

jeffometer commented 4 months ago

Hi @zzstoatzz, thanks for sharing that. It looks close to what I want and might work.

The only part that I am not sure of is how well that works with composition. What I mean by that is that I really like having "normal" functions that call "ai" functions, whose result might be passed to another "normal" function. I'd like to be able to use tools in the "ai" function in the middle. I'm unclear if the assistants approach works in such a nice ergonomic way.

Does that clarify what I'm looking for better?

Thanks agian!