Thank you very much Jeremy for this amazing work 😀😀😀😀
@christophermanning2457 ай бұрын
I've been waiting for this for a long time !! Thanks a lot.
@wigglybenjamin5 ай бұрын
IMPORTANT NOTE for the chapter on spec params: You can have schemars inline the referenced schema definitions for you AUTOMATICALLY. You just need to configure the settings manually instead of using the schemars::schema_for! macro (which assumes some default settings). This code worked for me in tool_spec(): let settings = SchemaSettings::default().with(|settings| { settings.inline_subschemas = true; }); let root_schema = SchemaGenerator::new(settings).into_root_schema_for::(); let mut json_schema = serde_json::to_value(root_schema)?; Then you can completely get rid of the function into_spec_params() and just re-use what is left over of the json_schema object after extracting your title and description. You should probably also remove the key "$schema", which just holds some metadata. BTW: The implementation of the XValue trait in the video uses Value::take to extract elements, which leaves the keys behind. This isn't a problem if you are constructing a new value with selected elements and discarding the rest, but what I decided to do was to change the implementation to remove the entire entry, because I want to re-use the json_schema object for more flexibility.
@JeremyChone5 ай бұрын
Ho, that’s very cool. I did not notice that schemars setting. Also, yes, the x_take can and should be fine-tuned to the desired behavior. I just took one strategy, but I would agree that removing the entry completely might be even better. BTW, I like the x_… pattern because I can decide the logic I want for the app/lib code without wondering about externalizing. I sometimes have some vec utils as well as XVec. Thanks for sharing your notes. Good ones!
@Cryptopunkstar7 ай бұрын
Hi Jeremy ! I've been waiting for this for a long time !! Great thank 's
@sergioqcostas7 ай бұрын
Thanks a lot, exactly what I needed, one quick question, how can your api calls can retrieve weather? mine can't
@JeremyChone7 ай бұрын
So, first my get_weather RPC is just a mock. Clone the repo and run example 3, and it should work. I use rpc-router
@kashnigahbaruda7 ай бұрын
King
@josephaxelripto88176 ай бұрын
Can Ollama-rs perform function calling like in this video?
@JeremyChone6 ай бұрын
So, Ollama does not have such an API, but you can accomplish the same result by giving precise instructions and then reorganizing the chat messages with the tool response. Basically, you're doing what ChatGPT does, but manually. Mistral did talk about adding function calling to Mixtral, I think, but I'm not sure how this is exposed.
@josephaxelripto88176 ай бұрын
@@JeremyChone thanks for the answer. Do you have any example in rust?