Skip to content

Make OpenAI client more configurable#780

Draft
franciscodr wants to merge 6 commits intomainfrom
make-open-ai-configurable
Draft

Make OpenAI client more configurable#780
franciscodr wants to merge 6 commits intomainfrom
make-open-ai-configurable

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