frankfralick / openai-func-enums

A set of Rust macros for working with OpenAI function/tool calls.
MIT License
42 stars 2 forks source link

Support for non-enum function arguments? #2

Closed Boscop closed 1 year ago

Boscop commented 1 year ago

Thanks for making this crate, it seems very useful :)

But I'm wondering why does it have the restriction that function arguments must be enums?

It would be much more useful it it also allowed function arguments of normal primitive types, like string, int, float..

E.g. if GPT should invoke an external function for certain calculations or type checking generated code..

Would it be possible to allow primitive types?

frankfralick commented 1 year ago

It doesn't require that arguments are enums. It requires that functions are described as enums. Your functions can take value types. Look in the readme at the calculator example (under clap integration) where you have functions like "Add" that takes two f64 arguments. These could be whatever value type. Let me know if I misunderstood your question.