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

Add openai client config arguments #426

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alejandrodnm
Copy link
Contributor

@alejandrodnm alejandrodnm commented Feb 5, 2025

This PR continues the work from #219 . That PR was deemed to big so we are splitting the functionality in smaller PRs.

feat!: consolidate OpenAI client configuration

BREAKING CHANGE: Replace individual client configuration parameters with
a single client_config parameter. The base_url parameter has been
moved into the new configuration structure.

  • Add new ai.openai_client_config() function to generate client
    configurations
  • Remove base_url parameter from all OpenAI functions
  • Add client_config parameter to all OpenAI functions
  • Support additional client options: timeout, organization, project,
    max_retries, default_headers, default_query

Migration:
Old:

  SELECT ai.openai_embed(
    model => 'model',
    input_text => 'text',
    base_url => 'url'
  );

New:

  SELECT ai.openai_embed(
    model => 'model',
    input_text => 'text',
    client_config => ai.openai_client_config(base_url => 'url')
  );

@alejandrodnm alejandrodnm force-pushed the adn/openai-client-args branch 5 times, most recently from 4ae20db to ffcfb98 Compare February 5, 2025 13:06
@alejandrodnm alejandrodnm marked this pull request as ready for review February 5, 2025 13:20
@alejandrodnm alejandrodnm requested a review from a team as a code owner February 5, 2025 13:20
@alejandrodnm alejandrodnm force-pushed the adn/openai-raw-response branch 2 times, most recently from 548ff97 to bf33286 Compare February 6, 2025 20:28
@alejandrodnm alejandrodnm force-pushed the adn/openai-client-args branch 5 times, most recently from 357c9c0 to be5b0ee Compare February 6, 2025 21:58
@alejandrodnm alejandrodnm force-pushed the adn/openai-raw-response branch from bf33286 to 15d7609 Compare February 7, 2025 07:59
Base automatically changed from adn/openai-raw-response to main February 7, 2025 08:03
@alejandrodnm alejandrodnm force-pushed the adn/openai-client-args branch from be5b0ee to 486ed03 Compare February 7, 2025 09:17
BREAKING CHANGE: Replace individual client configuration parameters with
a single `client_config` parameter. The `base_url` parameter has been
moved into the new configuration structure.

- Add new `ai.openai_client_config()` function to generate client
  configurations
- Remove `base_url` parameter from all OpenAI functions
- Add `client_config` parameter to all OpenAI functions
- Support additional client options: timeout_seconds, organization,
  project, max_retries, default_headers, default_query

Migration:
Old:
  SELECT ai.openai_embed(
    model => 'model',
    input_text => 'text',
    base_url => 'url'
  );

New:
  SELECT ai.openai_embed(
    model => 'model',
    input_text => 'text',
    client_config => ai.openai_client_config(base_url => 'url')
  );
@alejandrodnm alejandrodnm enabled auto-merge (rebase) February 7, 2025 17:44
@alejandrodnm alejandrodnm disabled auto-merge February 7, 2025 19:33
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.

3 participants