Skip to content

Commit 6e0b960

Browse files
committed
feat: test
1 parent fde1534 commit 6e0b960

File tree

3 files changed

+13
-67
lines changed

3 files changed

+13
-67
lines changed

packages/code-review-gpt/src/args.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const getYargs = async (): Promise<ReviewArgs> => {
4949
.option("model", {
5050
description: "The model to use for generating the review.",
5151
type: "string",
52-
default: "gpt-4",
52+
default: "gpt-4o",
5353
})
5454
.option("reviewType", {
5555
description:
@@ -79,7 +79,7 @@ export const getYargs = async (): Promise<ReviewArgs> => {
7979
description: "Provider to use for AI",
8080
choices: ["openai", "bedrock", "azure"],
8181
type: "string",
82-
default: "openai",
82+
default: "azure",
8383
})
8484
.command("review", "Review the pull request.")
8585
.command("configure", "Configure the script.")

packages/code-review-gpt/src/common/model/AIModel.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { retryAsync } from "ts-retry";
44
import { IFeedback } from "../types";
55
import { logger } from "../utils/logger";
66
import { parseAttributes } from "../utils/parseAttributes";
7-
import { AzureGptChat } from './AzureGptChat';
87

98
interface IAIModel {
109
modelName: string;
@@ -18,7 +17,7 @@ interface IAIModel {
1817
const defaultRetryCount = 3;
1918

2019
class AIModel {
21-
private model: OpenAIChat | AzureGptChat;
20+
private model: OpenAIChat;
2221
private retryCount: number;
2322

2423
constructor(options: IAIModel) {
@@ -32,11 +31,17 @@ class AIModel {
3231
});
3332
break;
3433
case "azure":
35-
this.model = new AzureGptChat({
36-
apiKey: options.apiKey,
34+
this.model = new OpenAIChat({
3735
modelName: options.modelName,
38-
temperature: options.temperature
39-
})
36+
temperature: options.temperature,
37+
configuration: { organization: options.organization },
38+
azureOpenAIApiVersion: '2024-04-01-preview',
39+
azureOpenAIApiKey: options.apiKey,
40+
// azureOpenAIApiInstanceName
41+
azureOpenAIApiDeploymentName: 'D-OAI-model-deploy',
42+
azureOpenAIBasePath: 'https://d-oai-dev.openai.azure.com',
43+
});
44+
break;
4045
case "bedrock":
4146
throw new Error("Bedrock provider not implemented");
4247
default:

packages/code-review-gpt/src/common/model/AzureGptChat.ts

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)