Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Refactoring] OpenAIClient other parameters #18

Open
brunocapelao opened this issue Jan 6, 2024 · 0 comments
Open

[Refactoring] OpenAIClient other parameters #18

brunocapelao opened this issue Jan 6, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@brunocapelao
Copy link
Owner

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

@brunocapelao brunocapelao added the enhancement New feature or request label Jan 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: No status
Development

No branches or pull requests

1 participant