#openai #ai #open #calling #sugar #syntactic #fn

macro open_ai_rust_fn_call_extension

Macros for Open AI function calling to be used with the open_ai_rust crate for syntactic sugar

24 releases

0.2.17 Aug 12, 2024
0.2.16 Aug 12, 2024
0.1.6 Aug 12, 2024

#8 in #syntactic

Download history 996/week @ 2024-08-06 612/week @ 2024-08-13 1/week @ 2024-08-27 50/week @ 2024-09-10 4/week @ 2024-09-17 19/week @ 2024-09-24 26/week @ 2024-10-01

257 downloads per month
Used in open_ai_rust

MIT license

9KB
134 lines

open_ai_rust_fn_extensions

Macros for Open AI function calling. Designed specifically to be used with the open_ai_rust crate for syntactic sugar which I also developed.

That crate uses this internally and so you can use it in a far more optimal way through there.

Example: #[function_call("This function changes the light state.")] fn change_light(on: bool, extra_data: Arg) { // Function body }

Becomes this: FUNCTION_CALL FunctionCall { name: "change_light", description: "This function changes the light state.", parameters: ["on: bool", "extra_data: Arg", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""] }

I am currently working on this overtime to make it fully comprehensive and impressive.

Dependencies

~1.7–2.4MB
~55K SLoC