fix text-completion

This commit is contained in:
Haiping Chen 2024-07-24 10:03:12 -05:00
parent d3f899853d
commit 042aee6b91
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;
}