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

Easily Swap Endpoints to non OpenAI/Microsoft sources #125

Closed
yosun opened this issue Nov 21, 2023 · 2 comments
Closed

Easily Swap Endpoints to non OpenAI/Microsoft sources #125

yosun opened this issue Nov 21, 2023 · 2 comments
Labels
question Further information is requested

Comments

@yosun
Copy link

yosun commented Nov 21, 2023

Feature Request

Is your feature request related to a problem? Please describe.

Easily Swap Endpoints to non OpenAI/Microsoft sources

Describe the solution you'd like

Something that does not require going in your OpenAISettingsInfo and manually replacing internal const strings

Describe alternatives you've considered

Maybe simply exposing endpoint url in inspector

Also ideally more easily editable schema mapping

Additional context

Lots of solutions other than OpenAI/MS providing streaming chat completions etc.

@yosun yosun added the enhancement New feature or request label Nov 21, 2023
@StephenHodgson
Copy link
Member

StephenHodgson commented Nov 21, 2023

You can create as many instances of OpenAIClient as you need with custom settings to fulfill this purpose.

@StephenHodgson
Copy link
Member

StephenHodgson commented Nov 21, 2023

For example:

// Vanilla OpenAI 
var openai = new OpenAIClient("apikey");

// Custom proxy
 var authToken = await LoginAsync();
var auth = new OpenAIAuthentication($"sess-{authToken}");
var settings = new OpenAISettings(domain: "api.your-custom-domain.com");
var proxyAI = new OpenAIClient(auth, settings);

// Azure OpenAI gpt3.5-turbo
var azureAuth = new OpenAIAuthentication("sk-apiKey");
var gpt35TurboSettings = new OpenAISettings(resourceName: "your.resource.name", deploymentId: "gpt-3.5-turbo", apiVersion: "api-version");
var azureGpt35Turbo = new OpenAIClient(azureAuth, gpt35TurboSettings);

// Azure OpenAI gpt-4
var azuregpt4Settings = new OpenAISettings(resourceName: "your.resource.name", deploymentId: "gpt-4", apiVersion: "api-version");
var azureGpt4 = new OpenAIClient(azureAuth, azuregpt4Settings);

@StephenHodgson StephenHodgson added question Further information is requested and removed enhancement New feature or request labels Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Development

No branches or pull requests

2 participants