You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the OpenAIClient class within our project restricts configuration to the API key during initialization. This limitation prevents users from defining other important parameters that influence the behavior and output of the OpenAI API, such as frequency_penalty, presence_penalty, and temperature, among others. The proposal is to refactor the OpenAIClient to allow a wider range of parameters to be passed during initialization, enabling more detailed control over the API's behavior.
Modify the init method of the OpenAIClient class to accept additional parameters such as frequency_penalty, logit_bias, max_tokens, presence_penalty, temperature, top_p, tools, tool_choice, among others.
Store these parameters as instance variables within the OpenAIClient class.
Update the get_model_response method to use these stored parameters when making API calls, applying the specified configurations.
Establish default values for these parameters, ensuring compatibility with existing implementations and facilitating usage.
Update the documentation of the class and methods to reflect these changes and provide guidance on using the new parameters.
Implement robust error handling to gracefully manage invalid or incompatible parameter values.
Acceptance Criteria:
The OpenAIClient class should be able to initialize with a wider range of configuration parameters.
API calls should correctly reflect the settings passed during initialization.
The refactoring should not break compatibility with existing implementations that use OpenAIClient.
The documentation should be clear and accurate, reflecting the new capabilities of the class.
Unit tests should be implemented to validate the new functionalities and ensure there are no regressions.
Detailed Description:
Currently, the OpenAIClient class within our project restricts configuration to the API key during initialization. This limitation prevents users from defining other important parameters that influence the behavior and output of the OpenAI API, such as frequency_penalty, presence_penalty, and temperature, among others. The proposal is to refactor the OpenAIClient to allow a wider range of parameters to be passed during initialization, enabling more detailed control over the API's behavior.
Modify the init method of the OpenAIClient class to accept additional parameters such as frequency_penalty, logit_bias, max_tokens, presence_penalty, temperature, top_p, tools, tool_choice, among others.
Store these parameters as instance variables within the OpenAIClient class.
Update the get_model_response method to use these stored parameters when making API calls, applying the specified configurations.
Establish default values for these parameters, ensuring compatibility with existing implementations and facilitating usage.
Update the documentation of the class and methods to reflect these changes and provide guidance on using the new parameters.
Implement robust error handling to gracefully manage invalid or incompatible parameter values.
Acceptance Criteria:
The OpenAIClient class should be able to initialize with a wider range of configuration parameters.
API calls should correctly reflect the settings passed during initialization.
The refactoring should not break compatibility with existing implementations that use OpenAIClient.
The documentation should be clear and accurate, reflecting the new capabilities of the class.
Unit tests should be implemented to validate the new functionalities and ensure there are no regressions.
Attachments (Optional):
https://platform.openai.com/docs/api-reference/chat/create
The text was updated successfully, but these errors were encountered: