Skip to content

Commit 5737556

Browse files
authored
Merge pull request #23 from AI21Labs/add_types_to_tsconfig
fix: Added types to index
2 parents 406afa2 + 92b3ff2 commit 5737556

File tree

2 files changed

+42
-2
lines changed

2 files changed

+42
-2
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"type": "module",
99
"exports": {
1010
".": {
11+
"types": "./dist/index.d.ts",
1112
"require": "./dist/bundle.cjs.js",
1213
"import": "./dist/bundle.es.js"
1314
}

src/index.ts

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,46 @@
11
export { AI21 } from './AI21';
22
export { VERSION } from './version';
3-
export * from './types';
3+
export {
4+
type DocumentSchema,
5+
type ChatCompletionCreateParams,
6+
type ChatCompletionCreateParamsNonStreaming,
7+
type ChatCompletionCreateParamsStreaming,
8+
type ChatMessage,
9+
type AssistantMessage,
10+
type ToolMessage,
11+
type UserMessage,
12+
type SystemMessage,
13+
type ChatMessageParam,
14+
type ToolDefinition,
15+
type ResponseFormat,
16+
type FunctionToolDefinition,
17+
type ToolFunction,
18+
type ToolParameters,
19+
type ToolCall,
20+
type ChatCompletionResponseChoice,
21+
type ChatCompletionResponse,
22+
type TopTokenData,
23+
type LogprobsData,
24+
type Logprobs,
25+
type ChoiceDelta,
26+
type ChoicesChunk,
27+
type ChatCompletionChunk,
28+
type ChatModel,
29+
type UsageInfo,
30+
type APIResponseProps,
31+
type RequestOptions,
32+
type FinalRequestOptions,
33+
type HTTPMethod,
34+
type DefaultQuery,
35+
type Headers,
36+
type CrossPlatformResponse,
37+
type ConversationalRagRequest,
38+
type ConversationalRagResponse,
39+
type ConversationalRagSource,
40+
type RetrievalStrategy,
41+
} from './types';
42+
export { APIClient } from './APIClient';
443
export { AI21Error, MissingAPIKeyError } from './errors';
544
export { Stream } from './streaming';
645
export { APIResource } from './APIResource';
7-
export { Chat, Completions } from './resources';
46+
export { Chat, Completions, ConversationalRag } from './resources';

0 commit comments

Comments
 (0)