Merge pull request #561 from hchen2020/master

fix text-completion
This commit is contained in:
C. Oceania 2024-07-24 10:05:03 -05:00 committed by GitHub
commit da79eec90c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -48,7 +48,7 @@ public class InstructModeController : ControllerBase
{
var state = _services.GetRequiredService<IConversationStateService>();
input.States.ForEach(x => state.SetState(x.Key, x.Value, activeRounds: x.ActiveRounds, source: StateSource.External));
state.SetState("provider", input.Provider, source: StateSource.External)
state.SetState("provider", input.Provider ?? "azure-openai", source: StateSource.External)
.SetState("model", input.Model, source: StateSource.External)
.SetState("model_id", input.ModelId, source: StateSource.External);

View file

@ -136,7 +136,7 @@ public class TextCompletionProvider : ITextCompletion
var endpoint = modelSetting.Endpoint.EndsWith("/") ?
modelSetting.Endpoint.Substring(0, modelSetting.Endpoint.Length - 1) : modelSetting.Endpoint;
url = $"{endpoint}/openai/deployments/{_model}/completions?api-version={modelSetting.Version}";
url = $"{endpoint}/openai/deployments/{_model}/completions?api-version=2023-09-15-preview";
return url;
}