-
-
Notifications
You must be signed in to change notification settings - Fork 128
Refactor Azure OpenAI Initialization and Model Handling #510
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -129,7 +129,7 @@ class AzureOpenAIService { | |
await writePromptToFile(systemPrompt, truncatedContent); | ||
|
||
const response = await this.client.chat.completions.create({ | ||
model: model, | ||
model: config.azure.deploymentName, //azure openai uses deployment name as model parameter | ||
messages: [ | ||
{ | ||
role: "system", | ||
|
@@ -228,7 +228,7 @@ class AzureOpenAIService { | |
|
||
// Make API request | ||
const response = await this.client.chat.completions.create({ | ||
model: process.env.AZURE_DEPLOYMENT_NAME, | ||
model: config.azure.deploymentName, //azure openai uses deployment name as model parameter | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It uses the deploymentName already here. Just loaded from ENV There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes but to make it consistent i used the configuration value here |
||
messages: [ | ||
{ | ||
role: "system", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -135,7 +135,7 @@ class SetupService { | |
deploymentName: deploymentName, | ||
apiVersion: apiVersion }); | ||
const response = await openai.chat.completions.create({ | ||
model: "gpt-4o-mini", | ||
model: deploymentName, //azure openai uses deployment name as model parameter | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At this point your suggestion is correct. |
||
messages: [{ role: "user", content: "Test" }], | ||
}); | ||
const now = new Date(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Model = deploymentName here. See line 65
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes but to make it consistent i used the configuration value here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No worries. That was not meant in a bad way. You are absolutely right with your improvements.
It were only review comments for documentary reasons.