Open carlo- opened 1 year ago
Could the type property in Parameters be an enum instead of string? I'm also wondering if you could make it less verbose by using generics for arguments and parameters, though I'm not sure how you would add the description in that case.
Also, what's the difference between assistantWithCall(content: String?, call: UnstructuredFunctionCall) and function I see in a switch statement?
Unfortunately I haven't had any time to come back to this, and looks like I won't be able to in the near future either, but feel free to edit any part of this PR 😊
Hi all! I've started working on adding support for functions. I have a rather rough implementation ready, so I wanted to check in here. Function calls from the models are inherently "unsafe", so this clashes a bit with the strict type safety of Swift; I think making this work in a neat way is an interesting challenge. What are your thoughts?
Here's how you'd define a function with my implementation (this example function can be used to search a database of recipes):
You would then send a chat request as usual, passing in the functions and the function "mode" (called "function_call" in the docs):
And then try to extract any function calls with type safety: