@fencyai/js 0.1.30 → 0.1.32
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/api/createChatCompletion.d.ts +2 -1
- package/lib/api/createChatCompletion.js +1 -1
- package/lib/api/createChatCompletionStream.d.ts +1 -1
- package/lib/api/createChatCompletionStream.js +1 -1
- package/lib/index.d.ts +11 -1
- package/lib/types/AnthropicModel.d.ts +1 -0
- package/lib/types/AnthropicModel.js +1 -0
- package/lib/types/ChatCompletion.d.ts +8 -0
- package/lib/types/ChatCompletion.js +7 -0
- package/lib/types/ChatCompletionMessage.d.ts +4 -0
- package/lib/types/ChatCompletionMessage.js +1 -0
- package/lib/types/ChatCompletionStream.d.ts +5 -0
- package/lib/types/ChatCompletionStream.js +7 -0
- package/lib/types/CreateAnthropicChatCompletionParams.d.ts +6 -0
- package/lib/types/CreateAnthropicChatCompletionParams.js +1 -0
- package/lib/types/CreateChatCompletionRequest.d.ts +10 -0
- package/lib/types/CreateChatCompletionRequest.js +1 -0
- package/lib/types/CreateGeminiChatCompletionParams.d.ts +6 -0
- package/lib/types/CreateGeminiChatCompletionParams.js +1 -0
- package/lib/types/CreateOpenAiChatCompletionParams.d.ts +7 -0
- package/lib/types/CreateOpenAiChatCompletionParams.js +1 -0
- package/lib/types/GeminiModel.d.ts +1 -0
- package/lib/types/GeminiModel.js +1 -0
- package/lib/types/OpenAiModel.d.ts +1 -0
- package/lib/types/OpenAiModel.js +1 -0
- package/lib/types.d.ts +0 -24
- package/lib/types.js +1 -11
- package/package.json +3 -2
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ChatCompletion
|
|
1
|
+
import { ChatCompletion } from '../types/ChatCompletion';
|
|
2
|
+
import { CreateChatCompletionRequest } from '../types/CreateChatCompletionRequest';
|
|
2
3
|
export interface CreateChatCompletionOptions {
|
|
3
4
|
apiUrl?: string;
|
|
4
5
|
request: CreateChatCompletionRequest;
|
package/lib/index.d.ts
CHANGED
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
import { createChatCompletion } from './api/createChatCompletion';
|
|
2
2
|
import { createChatCompletionStream } from './api/createChatCompletionStream';
|
|
3
3
|
import { loadFency } from './loadFency';
|
|
4
|
-
export type {
|
|
4
|
+
export type { FencyInstance, FencyOptions, } from './types';
|
|
5
|
+
export type { ChatCompletion, isChatCompletion } from './types/ChatCompletion';
|
|
6
|
+
export type { ChatCompletionMessage } from './types/ChatCompletionMessage';
|
|
7
|
+
export type { ChatCompletionStream } from './types/ChatCompletionStream';
|
|
8
|
+
export type { CreateChatCompletionRequest } from './types/CreateChatCompletionRequest';
|
|
9
|
+
export type { CreateAnthropicChatCompletionParams } from './types/CreateAnthropicChatCompletionParams';
|
|
10
|
+
export type { CreateGeminiChatCompletionParams } from './types/CreateGeminiChatCompletionParams';
|
|
11
|
+
export type { CreateOpenAiChatCompletionParams } from './types/CreateOpenAiChatCompletionParams';
|
|
12
|
+
export type { AnthropicModel } from './types/AnthropicModel';
|
|
13
|
+
export type { GeminiModel } from './types/GeminiModel';
|
|
14
|
+
export type { OpenAiModel } from './types/OpenAiModel';
|
|
5
15
|
export { createChatCompletion } from './api/createChatCompletion';
|
|
6
16
|
export type { CreateChatCompletionOptions } from './api/createChatCompletion';
|
|
7
17
|
export { createChatCompletionStream } from './api/createChatCompletionStream';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type AnthropicModel = 'claude-opus-4-0' | 'claude-sonnet-4-0';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CreateAnthropicChatCompletionParams } from './CreateAnthropicChatCompletionParams';
|
|
2
|
+
import { CreateGeminiChatCompletionParams } from './CreateGeminiChatCompletionParams';
|
|
3
|
+
import { CreateOpenAiChatCompletionParams } from './CreateOpenAiChatCompletionParams';
|
|
4
|
+
export interface CreateChatCompletionRequest {
|
|
5
|
+
streamId?: string;
|
|
6
|
+
sessionClientSecret?: string;
|
|
7
|
+
openai?: CreateOpenAiChatCompletionParams;
|
|
8
|
+
gemini?: CreateGeminiChatCompletionParams;
|
|
9
|
+
anthropic?: CreateAnthropicChatCompletionParams;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type GeminiModel = 'gemini-2.5-pro' | 'gemini-2.5-flash' | 'gemini-2.5-flash-lite-preview-06-17';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type OpenAiModel = 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-4.1-nano' | 'gpt-4o' | 'gpt-4o-mini';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/lib/types.d.ts
CHANGED
|
@@ -15,27 +15,3 @@ export interface FencyInstance {
|
|
|
15
15
|
publishableKey: string;
|
|
16
16
|
baseUrl: string;
|
|
17
17
|
}
|
|
18
|
-
export interface ChatCompletionStream {
|
|
19
|
-
chatCompletionStreamId: string;
|
|
20
|
-
}
|
|
21
|
-
export declare const isChatCompletionStream: (data: any) => data is ChatCompletionStream;
|
|
22
|
-
export type OpenAiModel = 'gpt-4o' | 'gpt-4o-mini' | 'gpt-3.5-turbo';
|
|
23
|
-
export interface CreateChatCompletionRequest {
|
|
24
|
-
chatCompletionStreamId?: string;
|
|
25
|
-
openai: {
|
|
26
|
-
model: OpenAiModel;
|
|
27
|
-
responseJsonSchema?: string;
|
|
28
|
-
messages: Array<{
|
|
29
|
-
role: 'user' | 'assistant' | 'system';
|
|
30
|
-
content: string;
|
|
31
|
-
}>;
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
export type ChatCompletion = {
|
|
35
|
-
chatCompletionId: string;
|
|
36
|
-
chatCompletionStreamId?: string;
|
|
37
|
-
response?: string;
|
|
38
|
-
responseIsStructured?: boolean;
|
|
39
|
-
createdAt: string;
|
|
40
|
-
};
|
|
41
|
-
export declare const isChatCompletion: (data: any) => data is ChatCompletion;
|
package/lib/types.js
CHANGED
|
@@ -1,11 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
return (typeof data === 'object' &&
|
|
3
|
-
data !== null &&
|
|
4
|
-
'chatCompletionStreamId' in data);
|
|
5
|
-
};
|
|
6
|
-
export const isChatCompletion = (data) => {
|
|
7
|
-
return (typeof data === 'object' &&
|
|
8
|
-
data !== null &&
|
|
9
|
-
'chatCompletionId' in data &&
|
|
10
|
-
'createdAt' in data);
|
|
11
|
-
};
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fencyai/js",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.32",
|
|
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": "a487d68673a259c2490b83a9a6fba991ea02d034"
|
|
42
43
|
}
|