@fencyai/js 0.1.30 → 0.1.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.d.ts +1 -1
- package/lib/types.d.ts +14 -8
- package/package.json +3 -2
package/lib/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createChatCompletion } from './api/createChatCompletion';
|
|
2
2
|
import { createChatCompletionStream } from './api/createChatCompletionStream';
|
|
3
3
|
import { loadFency } from './loadFency';
|
|
4
|
-
export type { ChatCompletion, ChatCompletionStream, FencyInstance, FencyOptions, } from './types';
|
|
4
|
+
export type { AnthropicModel, ChatCompletion, ChatCompletionMessage, ChatCompletionStream, CreateSynchronousChatCompletionParams, CreateChatCompletionRequest, FencyInstance, FencyOptions, GeminiModel, OpenAiModel, } from './types';
|
|
5
5
|
export { createChatCompletion } from './api/createChatCompletion';
|
|
6
6
|
export type { CreateChatCompletionOptions } from './api/createChatCompletion';
|
|
7
7
|
export { createChatCompletionStream } from './api/createChatCompletionStream';
|
package/lib/types.d.ts
CHANGED
|
@@ -18,18 +18,24 @@ export interface FencyInstance {
|
|
|
18
18
|
export interface ChatCompletionStream {
|
|
19
19
|
chatCompletionStreamId: string;
|
|
20
20
|
}
|
|
21
|
+
export type ChatCompletionMessage = {
|
|
22
|
+
role: 'user' | 'assistant' | 'system';
|
|
23
|
+
content: string;
|
|
24
|
+
};
|
|
21
25
|
export declare const isChatCompletionStream: (data: any) => data is ChatCompletionStream;
|
|
22
26
|
export type OpenAiModel = 'gpt-4o' | 'gpt-4o-mini' | 'gpt-3.5-turbo';
|
|
27
|
+
export type GeminiModel = 'gemini-1.5-flash' | 'gemini-2.0-flash';
|
|
28
|
+
export type AnthropicModel = 'claude-3-5-sonnet' | 'claude-3-opus';
|
|
29
|
+
export type CreateSynchronousChatCompletionParams<T extends OpenAiModel | GeminiModel | AnthropicModel> = {
|
|
30
|
+
model: T;
|
|
31
|
+
messages: Array<ChatCompletionMessage>;
|
|
32
|
+
responseJsonSchema?: string;
|
|
33
|
+
};
|
|
23
34
|
export interface CreateChatCompletionRequest {
|
|
24
35
|
chatCompletionStreamId?: string;
|
|
25
|
-
openai
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
messages: Array<{
|
|
29
|
-
role: 'user' | 'assistant' | 'system';
|
|
30
|
-
content: string;
|
|
31
|
-
}>;
|
|
32
|
-
};
|
|
36
|
+
openai?: CreateSynchronousChatCompletionParams<OpenAiModel>;
|
|
37
|
+
gemini?: CreateSynchronousChatCompletionParams<GeminiModel>;
|
|
38
|
+
anthropic?: CreateSynchronousChatCompletionParams<AnthropicModel>;
|
|
33
39
|
}
|
|
34
40
|
export type ChatCompletion = {
|
|
35
41
|
chatCompletionId: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fencyai/js",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.31",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "staklau <steinaageklaussen@gmail.com>",
|
|
6
6
|
"homepage": "",
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|
|
28
28
|
"build": "tsc",
|
|
29
|
+
"build:watch": "tsc --watch",
|
|
29
30
|
"test": "jest",
|
|
30
31
|
"test:watch": "jest --watch",
|
|
31
32
|
"dev": "tsc --watch",
|
|
@@ -38,5 +39,5 @@
|
|
|
38
39
|
"ts-jest": "^29.1.1",
|
|
39
40
|
"typescript": "^5.3.3"
|
|
40
41
|
},
|
|
41
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "f39a452d0e2f90f06abc307f8aa04edbb7121680"
|
|
42
43
|
}
|