@stainless-api/docs-ai-chat 0.1.0-beta.45 → 0.1.0-beta.46
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/CHANGELOG.md +15 -0
- package/ambient-modules.d.ts +7 -0
- package/package.json +2 -2
- package/src/DocsChat.tsx +13 -13
- package/tsconfig.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @stainless-api/docs-ai-chat
|
|
2
2
|
|
|
3
|
+
## 0.1.0-beta.46
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 9d24589: Steelie empty state
|
|
8
|
+
- 5263b85: Loading state for ai chat
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- 9d24589: Various steelie UI fixes
|
|
13
|
+
- Updated dependencies [9d24589]
|
|
14
|
+
- Updated dependencies [9d24589]
|
|
15
|
+
- Updated dependencies [5263b85]
|
|
16
|
+
- @stainless-api/ai-chat@0.1.0-beta.8
|
|
17
|
+
|
|
3
18
|
## 0.1.0-beta.45
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stainless-api/docs-ai-chat",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.46",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@streamparser/json-whatwg": "^0.0.22",
|
|
15
15
|
"zod": "^4.3.6",
|
|
16
|
-
"@stainless-api/ai-chat": "0.1.0-beta.
|
|
16
|
+
"@stainless-api/ai-chat": "0.1.0-beta.8"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@types/react": "19.2.14",
|
package/src/DocsChat.tsx
CHANGED
|
@@ -3,6 +3,19 @@ import type { DocsLanguage } from '@stainless-api/docs-ui/routing';
|
|
|
3
3
|
import { setResponseMetadata, submitResponseFeedback } from './api';
|
|
4
4
|
import { useChat } from './hook';
|
|
5
5
|
|
|
6
|
+
function onCopyMessage(spanId: string) {
|
|
7
|
+
setResponseMetadata(spanId, { copied_to_clipboard: 'true' }).catch(() => {});
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
async function rateMessage(spanId: string, rating: 'up' | 'down'): Promise<boolean> {
|
|
11
|
+
try {
|
|
12
|
+
const { success } = await submitResponseFeedback(spanId, { up: 1 as const, down: 0 as const }[rating]);
|
|
13
|
+
return success;
|
|
14
|
+
} catch {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
6
19
|
export default function DocsChat({
|
|
7
20
|
projectId,
|
|
8
21
|
language,
|
|
@@ -18,19 +31,6 @@ export default function DocsChat({
|
|
|
18
31
|
siteTitle,
|
|
19
32
|
});
|
|
20
33
|
|
|
21
|
-
const rateMessage = async (spanId: string, rating: 'up' | 'down'): Promise<boolean> => {
|
|
22
|
-
try {
|
|
23
|
-
const { success } = await submitResponseFeedback(spanId, { up: 1 as const, down: 0 as const }[rating]);
|
|
24
|
-
return success;
|
|
25
|
-
} catch {
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
const onCopyMessage = (spanId: string) => {
|
|
31
|
-
setResponseMetadata(spanId, { copied_to_clipboard: 'true' }).catch(() => {});
|
|
32
|
-
};
|
|
33
|
-
|
|
34
34
|
return (
|
|
35
35
|
<AiChat
|
|
36
36
|
chatMessages={chatMessages}
|
package/tsconfig.json
CHANGED