Skip to content

Commit 4d21af3

Browse files
feat(api): api update
1 parent 653e24d commit 4d21af3

File tree

7 files changed

+7
-175
lines changed

7 files changed

+7
-175
lines changed

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 135
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-104cced8f4c7436a76eea02e26307828166405ccfb296faffb008b72772c11a7.yml
3-
openapi_spec_hash: fdc03ed84a65a31b80da909255e53924
1+
configured_endpoints: 134
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-f59befea071ed7729cbb7bce219e7f837eccfdb57e01698514e6a0bd6052ff60.yml
3+
openapi_spec_hash: b3a375ee523687d525d43e091e32b5eb
44
config_hash: 03b48e9b8c7231a902403210dbd7dfa0

api.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -477,13 +477,6 @@ Methods:
477477
Types:
478478

479479
- <code><a href="./src/resources/beta/chatkit/chatkit.ts">ChatKitWorkflow</a></code>
480-
- <code><a href="./src/resources/beta/chatkit/chatkit.ts">FilePart</a></code>
481-
- <code><a href="./src/resources/beta/chatkit/chatkit.ts">ImagePart</a></code>
482-
- <code><a href="./src/resources/beta/chatkit/chatkit.ts">ChatKitUploadFileResponse</a></code>
483-
484-
Methods:
485-
486-
- <code title="post /chatkit/files">client.beta.chatkit.<a href="./src/resources/beta/chatkit/chatkit.ts">uploadFile</a>({ ...params }) -> ChatKitUploadFileResponse</code>
487480

488481
### Sessions
489482

src/resources/beta/beta.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,7 @@ import {
7474
TranscriptionSessionUpdatedEvent,
7575
} from './realtime/realtime';
7676
import * as ChatKitAPI from './chatkit/chatkit';
77-
import {
78-
ChatKit,
79-
ChatKitUploadFileParams,
80-
ChatKitUploadFileResponse,
81-
ChatKitWorkflow,
82-
FilePart,
83-
ImagePart,
84-
} from './chatkit/chatkit';
77+
import { ChatKit, ChatKitWorkflow } from './chatkit/chatkit';
8578
import * as ThreadsAPI from './threads/threads';
8679
import {
8780
AssistantResponseFormatOption,

src/resources/beta/chatkit/chatkit.ts

Lines changed: 1 addition & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -30,35 +30,10 @@ import {
3030
ThreadListParams,
3131
Threads,
3232
} from './threads';
33-
import { APIPromise } from '../../../core/api-promise';
34-
import { type Uploadable } from '../../../core/uploads';
35-
import { buildHeaders } from '../../../internal/headers';
36-
import { RequestOptions } from '../../../internal/request-options';
37-
import { maybeMultipartFormRequestOptions } from '../../../internal/uploads';
3833

3934
export class ChatKit extends APIResource {
4035
sessions: SessionsAPI.Sessions = new SessionsAPI.Sessions(this._client);
4136
threads: ThreadsAPI.Threads = new ThreadsAPI.Threads(this._client);
42-
43-
/**
44-
* Upload a ChatKit file
45-
*
46-
* @example
47-
* ```ts
48-
* const response = await client.beta.chatkit.uploadFile({
49-
* file: fs.createReadStream('path/to/file'),
50-
* });
51-
* ```
52-
*/
53-
uploadFile(body: ChatKitUploadFileParams, options?: RequestOptions): APIPromise<ChatKitUploadFileResponse> {
54-
return this._client.post(
55-
'/chatkit/files',
56-
maybeMultipartFormRequestOptions(
57-
{ body, ...options, headers: buildHeaders([{ 'OpenAI-Beta': 'chatkit_beta=v1' }, options?.headers]) },
58-
this._client,
59-
),
60-
);
61-
}
6237
}
6338

6439
/**
@@ -100,97 +75,11 @@ export namespace ChatKitWorkflow {
10075
}
10176
}
10277

103-
/**
104-
* Metadata for a non-image file uploaded through ChatKit.
105-
*/
106-
export interface FilePart {
107-
/**
108-
* Unique identifier for the uploaded file.
109-
*/
110-
id: string;
111-
112-
/**
113-
* MIME type reported for the uploaded file. Defaults to null when unknown.
114-
*/
115-
mime_type: string | null;
116-
117-
/**
118-
* Original filename supplied by the uploader. Defaults to null when unnamed.
119-
*/
120-
name: string | null;
121-
122-
/**
123-
* Type discriminator that is always `file`.
124-
*/
125-
type: 'file';
126-
127-
/**
128-
* Signed URL for downloading the uploaded file. Defaults to null when no download
129-
* link is available.
130-
*/
131-
upload_url: string | null;
132-
}
133-
134-
/**
135-
* Metadata for an image uploaded through ChatKit.
136-
*/
137-
export interface ImagePart {
138-
/**
139-
* Unique identifier for the uploaded image.
140-
*/
141-
id: string;
142-
143-
/**
144-
* MIME type of the uploaded image.
145-
*/
146-
mime_type: string;
147-
148-
/**
149-
* Original filename for the uploaded image. Defaults to null when unnamed.
150-
*/
151-
name: string | null;
152-
153-
/**
154-
* Preview URL that can be rendered inline for the image.
155-
*/
156-
preview_url: string;
157-
158-
/**
159-
* Type discriminator that is always `image`.
160-
*/
161-
type: 'image';
162-
163-
/**
164-
* Signed URL for downloading the uploaded image. Defaults to null when no download
165-
* link is available.
166-
*/
167-
upload_url: string | null;
168-
}
169-
170-
/**
171-
* Represents either a file or image attachment.
172-
*/
173-
export type ChatKitUploadFileResponse = FilePart | ImagePart;
174-
175-
export interface ChatKitUploadFileParams {
176-
/**
177-
* Binary file contents to store with the ChatKit session. Supports PDFs and PNG,
178-
* JPG, JPEG, GIF, or WEBP images.
179-
*/
180-
file: Uploadable;
181-
}
182-
18378
ChatKit.Sessions = Sessions;
18479
ChatKit.Threads = Threads;
18580

18681
export declare namespace ChatKit {
187-
export {
188-
type ChatKitWorkflow as ChatKitWorkflow,
189-
type FilePart as FilePart,
190-
type ImagePart as ImagePart,
191-
type ChatKitUploadFileResponse as ChatKitUploadFileResponse,
192-
type ChatKitUploadFileParams as ChatKitUploadFileParams,
193-
};
82+
export { type ChatKitWorkflow as ChatKitWorkflow };
19483

19584
export { Sessions as Sessions, type SessionCreateParams as SessionCreateParams };
19685

src/resources/beta/chatkit/index.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
export {
4-
ChatKit,
5-
type ChatKitWorkflow,
6-
type FilePart,
7-
type ImagePart,
8-
type ChatKitUploadFileResponse,
9-
type ChatKitUploadFileParams,
10-
} from './chatkit';
3+
export { ChatKit, type ChatKitWorkflow } from './chatkit';
114
export { Sessions, type SessionCreateParams } from './sessions';
125
export {
136
Threads,

src/resources/beta/index.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,7 @@ export {
2020
} from './assistants';
2121
export { Beta } from './beta';
2222
export { Realtime } from './realtime/index';
23-
export {
24-
ChatKit,
25-
type ChatKitWorkflow,
26-
type FilePart,
27-
type ImagePart,
28-
type ChatKitUploadFileResponse,
29-
type ChatKitUploadFileParams,
30-
} from './chatkit/index';
23+
export { ChatKit, type ChatKitWorkflow } from './chatkit/index';
3124
export {
3225
Threads,
3326
type AssistantResponseFormatOption,

tests/api-resources/beta/chatkit/chatkit.test.ts

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

0 commit comments

Comments
 (0)