@fencyai/react 0.1.29 → 0.1.30
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/FencyProvider.js
CHANGED
|
@@ -10,21 +10,20 @@ export function FencyProvider({ fency, children }) {
|
|
|
10
10
|
const [fencyInstance, setFencyInstance] = useState(null);
|
|
11
11
|
const [loading, setLoading] = useState(true);
|
|
12
12
|
const [error, setError] = useState(null);
|
|
13
|
-
console.log('new fency provider');
|
|
14
13
|
useEffect(() => {
|
|
15
14
|
fency
|
|
16
15
|
.then((instance) => {
|
|
17
|
-
console.log('fency instance', instance);
|
|
18
16
|
setFencyInstance(instance);
|
|
19
17
|
setLoading(false);
|
|
20
18
|
})
|
|
21
19
|
.catch((err) => {
|
|
22
|
-
console.log('fency error', err);
|
|
23
|
-
console.error(err);
|
|
24
20
|
setError(err);
|
|
25
21
|
setLoading(false);
|
|
26
22
|
});
|
|
27
23
|
}, [fency]);
|
|
24
|
+
if (error) {
|
|
25
|
+
return _jsxs("div", { children: ["Fency error: ", error.message] });
|
|
26
|
+
}
|
|
28
27
|
// Only render children and provide context when fency is loaded
|
|
29
28
|
if (!fencyInstance) {
|
|
30
29
|
return null;
|
|
@@ -34,9 +33,5 @@ export function FencyProvider({ fency, children }) {
|
|
|
34
33
|
loading,
|
|
35
34
|
error,
|
|
36
35
|
};
|
|
37
|
-
console.log('error', error);
|
|
38
|
-
if (error) {
|
|
39
|
-
return _jsxs("div", { children: ["Fency error: ", error.message] });
|
|
40
|
-
}
|
|
41
36
|
return (_jsx(FencyContextValue.Provider, { value: value, children: children }));
|
|
42
37
|
}
|
|
@@ -38,7 +38,6 @@ export function useChatCompletion() {
|
|
|
38
38
|
const jsonSchema = params.responseFormat
|
|
39
39
|
? z.toJSONSchema(params.responseFormat)
|
|
40
40
|
: undefined;
|
|
41
|
-
console.log(jsonSchema);
|
|
42
41
|
const chatCompletion = await createChatCompletion({
|
|
43
42
|
pk: fency.fency.publishableKey,
|
|
44
43
|
baseUrl: fency.fency.baseUrl,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fencyai/react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.30",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "staklau <steinaageklaussen@gmail.com>",
|
|
6
6
|
"homepage": "",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"zod": "^4.0.5"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@fencyai/js": "^0.1.
|
|
38
|
+
"@fencyai/js": "^0.1.30",
|
|
39
39
|
"@types/jest": "^29.5.11",
|
|
40
40
|
"@types/node": "^20.10.5",
|
|
41
41
|
"@types/react": "^18.2.45",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"typescript": "^5.3.3"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"@fencyai/js": "^0.1.
|
|
47
|
+
"@fencyai/js": "^0.1.30",
|
|
48
48
|
"react": ">=16.8.0"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "ee47632e633fd659d4cfdf8c07bbe8c543764973"
|
|
51
51
|
}
|