File tree Expand file tree Collapse file tree 4 files changed +6
-16
lines changed
src/resources/containers/files
tests/api-resources/containers/files Expand file tree Collapse file tree 4 files changed +6
-16
lines changed Original file line number Diff line number Diff line change 1
1
configured_endpoints : 111
2
2
openapi_spec_url : https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-d4bcffecf0cdadf746faa6708ed1ec81fac451f9b857deabbab26f0a343b9314.yml
3
3
openapi_spec_hash : 7c54a18b4381248bda7cc34c52142615
4
- config_hash : 2102e4b25bbcab5d32d5ffa5d34daa0c
4
+ config_hash : d23f847b9ebb3f427d0f198035bd3e9f
Original file line number Diff line number Diff line change @@ -809,4 +809,4 @@ Methods:
809
809
810
810
Methods:
811
811
812
- - <code title =" get /containers/{container_id}/files/{file_id}/content " >client.containers.files.content.<a href =" ./src/resources/containers/files/content.ts " >retrieve</a >(containerId, fileId) -> void </code >
812
+ - <code title =" get /containers/{container_id}/files/{file_id}/content " >client.containers.files.content.<a href =" ./src/resources/containers/files/content.ts " >retrieve</a >(containerId, fileId) -> Response </code >
Original file line number Diff line number Diff line change 2
2
3
3
import { APIResource } from '../../../resource' ;
4
4
import * as Core from '../../../core' ;
5
+ import { type Response } from '../../../_shims/index' ;
5
6
6
7
export class Content extends APIResource {
7
8
/**
8
9
* Retrieve Container File Content
9
10
*/
10
- retrieve ( containerId : string , fileId : string , options ?: Core . RequestOptions ) : Core . APIPromise < void > {
11
+ retrieve ( containerId : string , fileId : string , options ?: Core . RequestOptions ) : Core . APIPromise < Response > {
11
12
return this . _client . get ( `/containers/${ containerId } /files/${ fileId } /content` , {
12
13
...options ,
13
- headers : { Accept : '*/*' , ...options ?. headers } ,
14
+ headers : { Accept : 'application/binary' , ...options ?. headers } ,
15
+ __binaryResponse : true ,
14
16
} ) ;
15
17
}
16
18
}
Original file line number Diff line number Diff line change 1
1
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
3
3
import OpenAI from 'openai' ;
4
- import { Response } from 'node-fetch' ;
5
4
6
5
const client = new OpenAI ( {
7
6
apiKey : 'My API Key' ,
8
7
baseURL : process . env [ 'TEST_API_BASE_URL' ] ?? 'http://127.0.0.1:4010' ,
9
8
} ) ;
10
9
11
10
describe ( 'resource content' , ( ) => {
12
- test ( 'retrieve' , async ( ) => {
13
- const responsePromise = client . containers . files . content . retrieve ( 'container_id' , 'file_id' ) ;
14
- const rawResponse = await responsePromise . asResponse ( ) ;
15
- expect ( rawResponse ) . toBeInstanceOf ( Response ) ;
16
- const response = await responsePromise ;
17
- expect ( response ) . not . toBeInstanceOf ( Response ) ;
18
- const dataAndResponse = await responsePromise . withResponse ( ) ;
19
- expect ( dataAndResponse . data ) . toBe ( response ) ;
20
- expect ( dataAndResponse . response ) . toBe ( rawResponse ) ;
21
- } ) ;
22
-
23
11
test ( 'retrieve: request options instead of params are passed correctly' , async ( ) => {
24
12
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
25
13
await expect (
You can’t perform that action at this time.
0 commit comments