LLamaSharp icon indicating copy to clipboard operation
LLamaSharp copied to clipboard

[Feature]: Support for Function Calling or Tools

Open dcostea opened this issue 1 year ago • 6 comments

Background & Description

Function calling is a feature supported by many open source models, like Mistral.

Function calling feature would allow developers to use LlamaSharp in a more dynamic way, enabling them to perform complex tasks directly within the LlamaSharp environment.

Are there plans to include function calling / tools in LLamaSharp?

API & Usage

No response

How to implement

No response

dcostea avatar Apr 28 '24 13:04 dcostea

Yes, it is important for using LLM to handling complex works. I'll start making this feature after about 1 month. :)

SanftMonster avatar Apr 28 '24 13:04 SanftMonster

It's pretty easy to hack together your own function calling. I used Hermes-2-Theta-LLama-3-8B and got acceptable results. What would be nice is C# native annotations that translate functions into OpenAI JSON, which the "function calling method" meta seems to have standardized around. Semantic Kernel also provides this feature if you really need it with their "planner" functionality, I chose to roll my own for resource constraint reasons

abhiaagarwal avatar May 27 '24 14:05 abhiaagarwal

It's pretty easy to hack together your own function calling. I used Hermes-2-Theta-LLama-3-8B and got acceptable results. What would be nice is C# native annotations that translate functions into OpenAI JSON, which the "function calling method" meta seems to have standardized around.

That's inspiring! May I ask whether you work is open-source? I wonder if I can take a look of your implementation if it's possible. :)

SanftMonster avatar May 27 '24 14:05 SanftMonster

Not yet! I'm currently working out kinks, but I hope to get it done ASAP

abhiaagarwal avatar May 27 '24 20:05 abhiaagarwal