@fencyai/react 0.1.56 → 0.1.58
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/types/CreateStructuredChatCompletionParams.d.ts +2 -2
- package/lib/types/StructuredChatCompletion.d.ts +2 -2
- package/lib/types/StructuredChatCompletionData.d.ts +2 -2
- package/lib/types/StructuredChatCompletionResponse.d.ts +2 -2
- package/lib/types/UseStructuredChatCompletions.d.ts +4 -4
- package/package.json +4 -4
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ZodType } from 'zod';
|
|
2
2
|
import { CreateOpenAiChatCompletionParams } from './CreateOpenAiChatCompletionParams';
|
|
3
3
|
import { CreateGeminiChatCompletionParams } from './CreateGeminiChatCompletionParams';
|
|
4
4
|
import { CreateClaudeChatCompletionParams } from './CreateClaudeChatCompletionParams';
|
|
5
5
|
import { CreateGenericChatCompletionParams } from './CreateGenericChatCompletionParams';
|
|
6
|
-
export interface CreateStructuredChatCompletionParams<T extends
|
|
6
|
+
export interface CreateStructuredChatCompletionParams<T extends ZodType> {
|
|
7
7
|
openai?: CreateOpenAiChatCompletionParams;
|
|
8
8
|
gemini?: CreateGeminiChatCompletionParams;
|
|
9
9
|
claude?: CreateClaudeChatCompletionParams;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ApiError } from '@fencyai/js';
|
|
2
|
-
import {
|
|
2
|
+
import { ZodType } from 'zod';
|
|
3
3
|
import { StructuredChatCompletionData } from './StructuredChatCompletionData';
|
|
4
|
-
export interface StructuredChatCompletion<T extends
|
|
4
|
+
export interface StructuredChatCompletion<T extends ZodType> {
|
|
5
5
|
triggeredAt: string;
|
|
6
6
|
data: StructuredChatCompletionData<T> | null;
|
|
7
7
|
error: ApiError | null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { z,
|
|
2
|
-
export interface StructuredChatCompletionData<T extends
|
|
1
|
+
import { z, ZodType } from 'zod';
|
|
2
|
+
export interface StructuredChatCompletionData<T extends ZodType> {
|
|
3
3
|
id: string;
|
|
4
4
|
createdAt: string;
|
|
5
5
|
response: object;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ApiError } from '@fencyai/js';
|
|
2
|
-
import {
|
|
2
|
+
import { ZodType } from 'zod';
|
|
3
3
|
import { StructuredChatCompletionData } from './StructuredChatCompletionData';
|
|
4
|
-
export type StructuredChatCompletionResponse<T extends
|
|
4
|
+
export type StructuredChatCompletionResponse<T extends ZodType> = {
|
|
5
5
|
type: 'success';
|
|
6
6
|
data: StructuredChatCompletionData<T>;
|
|
7
7
|
} | {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ZodType } from 'zod';
|
|
2
2
|
import { CreateStructuredChatCompletionParams } from './CreateStructuredChatCompletionParams';
|
|
3
3
|
import { StructuredChatCompletion } from './StructuredChatCompletion';
|
|
4
4
|
import { StructuredChatCompletionResponse } from './StructuredChatCompletionResponse';
|
|
5
5
|
export interface UseStructuredChatCompletions {
|
|
6
|
-
chatCompletions: StructuredChatCompletion<
|
|
7
|
-
createStructuredChatCompletion: <T extends
|
|
8
|
-
latest: StructuredChatCompletion<
|
|
6
|
+
chatCompletions: StructuredChatCompletion<ZodType>[];
|
|
7
|
+
createStructuredChatCompletion: <T extends ZodType>(params: CreateStructuredChatCompletionParams<T>) => Promise<StructuredChatCompletionResponse<T>>;
|
|
8
|
+
latest: StructuredChatCompletion<ZodType> | null;
|
|
9
9
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fencyai/react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.58",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "staklau <steinaageklaussen@gmail.com>",
|
|
6
6
|
"homepage": "",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"prepublishOnly": "npm run build"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@fencyai/js": "^0.1.
|
|
36
|
+
"@fencyai/js": "^0.1.58",
|
|
37
37
|
"@types/jest": "^29.5.11",
|
|
38
38
|
"@types/node": "^20.10.5",
|
|
39
39
|
"@types/react": "^18.2.45",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"typescript": "^5.3.3"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"@fencyai/js": "^0.1.
|
|
45
|
+
"@fencyai/js": "^0.1.58",
|
|
46
46
|
"react": ">=16.8.0",
|
|
47
47
|
"zod": "^4.0.5"
|
|
48
48
|
},
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"optional": false
|
|
52
52
|
}
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "c38cf67fa015b06ebf8d62329e228ca448d89330"
|
|
55
55
|
}
|