@@ -4,7 +4,6 @@ import { retryAsync } from "ts-retry";
4
4
import { IFeedback } from "../types" ;
5
5
import { logger } from "../utils/logger" ;
6
6
import { parseAttributes } from "../utils/parseAttributes" ;
7
- import { AzureGptChat } from './AzureGptChat' ;
8
7
9
8
interface IAIModel {
10
9
modelName : string ;
@@ -18,7 +17,7 @@ interface IAIModel {
18
17
const defaultRetryCount = 3 ;
19
18
20
19
class AIModel {
21
- private model : OpenAIChat | AzureGptChat ;
20
+ private model : OpenAIChat ;
22
21
private retryCount : number ;
23
22
24
23
constructor ( options : IAIModel ) {
@@ -32,11 +31,17 @@ class AIModel {
32
31
} ) ;
33
32
break ;
34
33
case "azure" :
35
- this . model = new AzureGptChat ( {
36
- apiKey : options . apiKey ,
34
+ this . model = new OpenAIChat ( {
37
35
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 ;
40
45
case "bedrock" :
41
46
throw new Error ( "Bedrock provider not implemented" ) ;
42
47
default :
0 commit comments