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

Make OpenAI client more configurable #780

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

franciscodr
Copy link
Contributor

This pull request is the first iteration to improve how Xef instantiates the OpenAI client. The proposed changes are:

  • Remove the default values for the properties of the Config data class in favor of providing a Default instance with such values.
  • Implement a ConfigBuilder to allow the users to change the default behavior by assigning different values to the properties. For instance:
Config {
  organization = "new-organization"
}
  • Add specific models to configure the timeout and retry policy for the HTTP client more intuitively. For example:
Config {
  httpClientRetryPolicy = HttpClientRetryPolicy.Incremental(
          interval = 250.milliseconds,
          maxDelay = 5.seconds,
          maxRetries = 5
        )
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant