-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Implement creation of "function" parameters at runtime #339
Implement creation of "function" parameters at runtime #339
Conversation
* Enable dynamic definition of "function" parameters instead of using Class instance * Add tests to new "function" capabilities * Add example of creating "function" parameters in runtime * Add documentation to ChatFunctions
Thanks for adding this feature, why hasn't the admin handled pr yet |
great job. This is a much needed feature. Hope it gets merged soon |
@TheoKanning There are new features coming from open ai and it would be helpful to merge this so we can start working on them. |
Is the author still maintaining it? Why hasn't it been adopted yet |
Anyone with the write access could have a look? Nothing really at risk and it would give us more flexibility. |
please merge this pr |
@TheoKanning can you merge this or is there a problem? |
@@ -98,7 +98,7 @@ public class ChatCompletionRequest { | |||
/** | |||
* A list of the available functions. | |||
*/ | |||
List<ChatFunction> functions; | |||
List<?> functions; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense for ChatFunction and ChatFunctionDynamic to implement a shared interface so that this can be typed as something other than <?>?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if just extending Runnable might be a good place to start?
It was not possible to define function parameters with custom properties such as name, type, and description at runtime. This pull request introduces an alternative way of creating a ChatFunction that allows for this.
The new ChatFunctionProperty class allows you to use a builder to add all the properties. Since the original ChatFunction class only accepts parameters that are instances of Class, I have created an additional class called ChatFunctionDynamic.
These changes make functions more flexible and powerful.
This pull request closes issue #333.