File tree Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -150397,6 +150397,9 @@ const MAX_PATCH_COUNT = process.env.MAX_PATCH_LENGTH
150397
150397
: Infinity;
150398
150398
const robot = (app) => {
150399
150399
const loadChat = async (context) => {
150400
+ if (process.env.USE_GITHUB_MODELS === 'true' && process.env.GITHUB_TOKEN) {
150401
+ return new chat_js_1.Chat(process.env.GITHUB_TOKEN);
150402
+ }
150400
150403
if (process.env.OPENAI_API_KEY) {
150401
150404
return new chat_js_1.Chat(process.env.OPENAI_API_KEY);
150402
150405
}
@@ -150574,7 +150577,7 @@ class Chat {
150574
150577
if (this.isAzure) {
150575
150578
// Azure OpenAI configuration
150576
150579
this.openai = new openai_1.AzureOpenAI({
150577
- apiKey: this.isGithubModels ? process.env.GITHUB_TOKEN : apikey,
150580
+ apiKey: apikey,
150578
150581
endpoint: process.env.OPENAI_API_ENDPOINT || '',
150579
150582
apiVersion: process.env.AZURE_API_VERSION || '',
150580
150583
deployment: process.env.AZURE_DEPLOYMENT || '',
Original file line number Diff line number Diff line change @@ -11,6 +11,10 @@ const MAX_PATCH_COUNT = process.env.MAX_PATCH_LENGTH
11
11
12
12
export const robot = ( app : Probot ) => {
13
13
const loadChat = async ( context : Context ) => {
14
+ if ( process . env . USE_GITHUB_MODELS === 'true' && process . env . GITHUB_TOKEN ) {
15
+ return new Chat ( process . env . GITHUB_TOKEN ) ;
16
+ }
17
+
14
18
if ( process . env . OPENAI_API_KEY ) {
15
19
return new Chat ( process . env . OPENAI_API_KEY ) ;
16
20
}
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ export class Chat {
15
15
if ( this . isAzure ) {
16
16
// Azure OpenAI configuration
17
17
this . openai = new AzureOpenAI ( {
18
- apiKey : this . isGithubModels ? process . env . GITHUB_TOKEN : apikey ,
18
+ apiKey : apikey ,
19
19
endpoint : process . env . OPENAI_API_ENDPOINT || '' ,
20
20
apiVersion : process . env . AZURE_API_VERSION || '' ,
21
21
deployment : process . env . AZURE_DEPLOYMENT || '' ,
You can’t perform that action at this time.
0 commit comments