File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
tests/api-resources/projects Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -20,10 +20,10 @@ export class MyModel {
20
20
private openlayerInferencePipelineId : string ;
21
21
22
22
constructor ( ) {
23
- this . openaiApiKey = process . env . OPENAI_API_KEY || '' ;
24
- this . openlayerApiKey = process . env . OPENLAYER_API_KEY || '' ;
23
+ this . openaiApiKey = process . env [ ' OPENAI_API_KEY' ] || '' ;
24
+ this . openlayerApiKey = process . env [ ' OPENLAYER_API_KEY' ] || '' ;
25
25
// (Optional) if set will enable monitoring requests
26
- this . openlayerInferencePipelineId = process . env . OPENLAYER_INFERENCE_PIPELINE_ID || '' ;
26
+ this . openlayerInferencePipelineId = process . env [ ' OPENLAYER_INFERENCE_PIPELINE_ID' ] || '' ;
27
27
28
28
const openlayerClient = new Openlayer ( { apiKey : this . openlayerApiKey } ) ;
29
29
@@ -49,7 +49,7 @@ export class MyModel {
49
49
} ,
50
50
undefined ,
51
51
) ;
52
- const result = ( response as ChatCompletion ) . choices [ 0 ] . message . content ;
52
+ const result = ( response as ChatCompletion ) . choices [ 0 ] ? .message . content ;
53
53
return { otherFields : { model } , output : result } ;
54
54
}
55
55
}
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ const openlayer = new Openlayer({
10
10
11
11
describe ( 'resource commits' , ( ) => {
12
12
test ( 'create: only required params' , async ( ) => {
13
- const responsePromise = client . projects . commits . create ( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' , {
13
+ const responsePromise = openlayer . projects . commits . create ( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' , {
14
14
commit : { message : 'Updated the prompt.' } ,
15
15
storageUri : 's3://...' ,
16
16
} ) ;
@@ -24,7 +24,7 @@ describe('resource commits', () => {
24
24
} ) ;
25
25
26
26
test ( 'create: required and optional params' , async ( ) => {
27
- const response = await client . projects . commits . create ( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' , {
27
+ const response = await openlayer . projects . commits . create ( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' , {
28
28
commit : { message : 'Updated the prompt.' } ,
29
29
storageUri : 's3://...' ,
30
30
archived : false ,
You can’t perform that action at this time.
0 commit comments