pepperoni21 / ollama-rs

A Rust library allowing to interact with the Ollama API.
MIT License
533 stars 79 forks source link

Function call example #64

Open pepperoni21 opened 3 months ago

pepperoni21 commented 3 months ago

Hey,

I think the examples folder lack a function call example. I tried implementing one myself but I can't get anything working fine since I don't know much about function calling.

rseymour commented 3 months ago

I will jump on this since it's a bit easier than the proc macro I've already started on ( #62 ), and I'm working on something that uses function calling now

rseymour commented 3 months ago

Here is a first draft (rough): https://github.com/rseymour/ollama-rs/blob/function-calling-example/examples/function_calling.rs but as you can see the tool response data goes from typed, to value, to string, to value, which seems contrived.

andthattoo commented 1 month ago

Hey @pepperoni21 I added 4-5 examples on test folder, do you need anything specific? I can add these examples