#openai #open #ai #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

#1023 in Procedural macros

Download history 207/week @ 2024-08-05 1401/week @ 2024-08-12 1/week @ 2024-08-26

1,609 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

~0.7–1.6MB
~35K SLoC