@aleph-alpha/chat-kit 1.5.3 → 1.7.0
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/dist/adapters/responses-api.d.ts +25 -18
- package/dist/adapters/responses-api.d.ts.map +1 -1
- package/dist/adapters/responses-api.js +13 -11
- package/dist/composables/fileUpload/index.d.ts +3 -2
- package/dist/composables/fileUpload/index.d.ts.map +1 -1
- package/dist/composables/index.d.ts +1 -1
- package/dist/composables/index.d.ts.map +1 -1
- package/dist/composables/index.js +4 -4
- package/dist/{index-UkdyL5Ku.js → index-BLq6_Lt2.js} +5 -3
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -6
- package/dist/types.d.ts +4 -3
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/adapters/responses-api.spec.ts +5 -4
- package/src/adapters/responses-api.ts +53 -39
- package/src/composables/fileUpload/index.ts +8 -2
- package/src/composables/index.ts +2 -0
- package/src/index.ts +14 -5
- package/src/types.ts +4 -3
|
@@ -18,20 +18,26 @@ export interface ResponseOutputTextPart {
|
|
|
18
18
|
annotations?: ResponseAnnotation[];
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
|
-
* One reasoning fragment inside a `ResponseOutputReasoning`. The
|
|
22
|
-
* API
|
|
23
|
-
*
|
|
21
|
+
* One reasoning summary fragment inside a `ResponseOutputReasoning`. The
|
|
22
|
+
* Responses API exposes the human-readable chain-of-thought trail under
|
|
23
|
+
* `summary` as an array of `summary_text` parts; the body is surfaced for
|
|
24
|
+
* consumers that want to render it (chat-kit itself only surfaces a
|
|
24
25
|
* "thinking" indicator).
|
|
26
|
+
*
|
|
27
|
+
* This part shape is **specific to reasoning outputs** — it never appears
|
|
28
|
+
* mixed with `ResponseOutputTextPart` inside a `ResponseOutputMessage`.
|
|
25
29
|
*/
|
|
26
30
|
export interface ResponseReasoningTextPart {
|
|
27
|
-
type: '
|
|
31
|
+
type: 'summary_text';
|
|
28
32
|
text: string;
|
|
29
33
|
annotations?: ResponseAnnotation[];
|
|
30
34
|
}
|
|
31
35
|
/**
|
|
32
36
|
* Forward-compatible catch-all for content parts whose `type` chat-kit does
|
|
33
|
-
* not yet model (e.g. refusals, future part kinds
|
|
34
|
-
* `type` themselves when they need richer
|
|
37
|
+
* not yet model (e.g. refusals, future part kinds inside `unknown`-typed
|
|
38
|
+
* fields). Consumers narrow on `type` themselves when they need richer
|
|
39
|
+
* handling. Not used inside `ResponseOutputMessage` or
|
|
40
|
+
* `ResponseOutputReasoning`, whose content shapes are fixed.
|
|
35
41
|
*/
|
|
36
42
|
export interface ResponseUnknownContentPart {
|
|
37
43
|
type: string;
|
|
@@ -39,35 +45,36 @@ export interface ResponseUnknownContentPart {
|
|
|
39
45
|
annotations?: ResponseAnnotation[];
|
|
40
46
|
[key: string]: unknown;
|
|
41
47
|
}
|
|
42
|
-
/**
|
|
43
|
-
* Discriminated union of content parts that can appear inside a Responses-
|
|
44
|
-
* API output item. `ResponseOutputTextPart` and `ResponseReasoningTextPart`
|
|
45
|
-
* cover the rendered shapes; the catch-all keeps the union open.
|
|
46
|
-
*/
|
|
47
|
-
export type OutputContentPart = ResponseOutputTextPart | ResponseReasoningTextPart | ResponseUnknownContentPart;
|
|
48
48
|
/**
|
|
49
49
|
* Visible message produced by a Responses-API turn (assistant reply or
|
|
50
50
|
* echoed user input). Carries the renderable text content; `responsesToTree`
|
|
51
|
-
* extracts text from `content` to build the chat tree.
|
|
51
|
+
* extracts text from `content` to build the chat tree. All entries are
|
|
52
|
+
* `ResponseOutputTextPart`s — no reasoning or unknown parts are mixed in.
|
|
52
53
|
*/
|
|
53
54
|
export interface ResponseOutputMessage {
|
|
54
55
|
type: 'message';
|
|
55
56
|
id: string;
|
|
56
57
|
status: string;
|
|
57
58
|
role: 'assistant' | 'user';
|
|
58
|
-
content:
|
|
59
|
+
content: ResponseOutputTextPart[];
|
|
59
60
|
}
|
|
60
61
|
/**
|
|
61
|
-
* Chain-of-thought trail produced by the assistant during a turn.
|
|
62
|
-
*
|
|
63
|
-
*
|
|
62
|
+
* Chain-of-thought trail produced by the assistant during a turn. The
|
|
63
|
+
* human-readable summary lives on `summary` as an array of
|
|
64
|
+
* `ResponseReasoningTextPart`s (all `summary_text`); `content` is reserved
|
|
65
|
+
* for the opaque/raw reasoning payload the API may attach and is kept
|
|
66
|
+
* `unknown` so consumers can downcast it on their own.
|
|
67
|
+
*
|
|
68
|
+
* Surfaced in chat-kit only as a "thinking" indicator; consumers may render
|
|
69
|
+
* the `summary` parts directly when desired.
|
|
64
70
|
*/
|
|
65
71
|
export interface ResponseOutputReasoning {
|
|
66
72
|
type: 'reasoning';
|
|
67
73
|
id: string;
|
|
68
74
|
status: string;
|
|
69
75
|
role?: 'assistant' | null;
|
|
70
|
-
|
|
76
|
+
summary: ResponseReasoningTextPart[];
|
|
77
|
+
content: unknown;
|
|
71
78
|
}
|
|
72
79
|
/**
|
|
73
80
|
* Single tool entry returned inside `mcp_list_tools` (and similar tool-
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"responses-api.d.ts","sourceRoot":"","sources":["../../src/adapters/responses-api.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EACV,gBAAgB,EAIjB,MAAM,UAAU,CAAC;AAMlB;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,aAAa,GAAG,MAAM,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,kBAAkB,EAAE,CAAC;CACpC;AAED
|
|
1
|
+
{"version":3,"file":"responses-api.d.ts","sourceRoot":"","sources":["../../src/adapters/responses-api.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EACV,gBAAgB,EAIjB,MAAM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IACd,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,MAAM,EAAE,cAAc,EAAE,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IACzC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;QACnC,WAAW,CAAC,EAAE,kBAAkB,EAAE,CAAC;KACpC,CAAC;IACF,YAAY,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,cAAc,EAAE,CAAC;CACxB;AAyJD;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,cAAc,EAAE,GAAG,gBAAgB,CAkE7E"}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { g as generateId } from "../generateId-BHf0W4Rq.js";
|
|
2
|
-
function extractMessageText(
|
|
3
|
-
if (typeof content === "string") return content.trim();
|
|
4
|
-
return extractTextFromParts(content);
|
|
5
|
-
}
|
|
6
|
-
function extractTextFromParts(parts) {
|
|
2
|
+
function extractMessageText(parts) {
|
|
7
3
|
let text = "";
|
|
8
4
|
for (const part of parts) {
|
|
9
5
|
if (part.type === "output_text" || part.type === "text") {
|
|
@@ -12,10 +8,10 @@ function extractTextFromParts(parts) {
|
|
|
12
8
|
}
|
|
13
9
|
return text.trim();
|
|
14
10
|
}
|
|
15
|
-
function
|
|
11
|
+
function extractReasoningSummary(parts) {
|
|
16
12
|
let text = "";
|
|
17
13
|
for (const part of parts) {
|
|
18
|
-
if (part.type === "
|
|
14
|
+
if (part.type === "summary_text") {
|
|
19
15
|
text += part.text ?? "";
|
|
20
16
|
}
|
|
21
17
|
}
|
|
@@ -29,7 +25,7 @@ function toAssistantParts(resp) {
|
|
|
29
25
|
for (const out of resp.output ?? []) {
|
|
30
26
|
switch (out.type) {
|
|
31
27
|
case "reasoning": {
|
|
32
|
-
const text =
|
|
28
|
+
const text = extractReasoningSummary(out.summary ?? []);
|
|
33
29
|
parts.push({
|
|
34
30
|
type: "reasoning",
|
|
35
31
|
id: out.id,
|
|
@@ -72,10 +68,16 @@ function getAssistantNodeId(resp) {
|
|
|
72
68
|
}
|
|
73
69
|
function extractInputText(rawContent) {
|
|
74
70
|
if (typeof rawContent === "string") return rawContent.trim();
|
|
75
|
-
if (Array.isArray(rawContent))
|
|
76
|
-
|
|
71
|
+
if (!Array.isArray(rawContent)) return "";
|
|
72
|
+
let text = "";
|
|
73
|
+
for (const raw of rawContent) {
|
|
74
|
+
if (!raw || typeof raw !== "object") continue;
|
|
75
|
+
const part = raw;
|
|
76
|
+
if ((part.type === "input_text" || part.type === "output_text" || part.type === "text") && typeof part.text === "string") {
|
|
77
|
+
text += part.text;
|
|
78
|
+
}
|
|
77
79
|
}
|
|
78
|
-
return
|
|
80
|
+
return text.trim();
|
|
79
81
|
}
|
|
80
82
|
function responseToMessageNodes(resp) {
|
|
81
83
|
const nodes = [];
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { DocumentUploadConfig
|
|
1
|
+
import type { DocumentUploadConfig } from './types';
|
|
2
2
|
import { createDocumentUploadProvider } from './useFileUploadWrapper';
|
|
3
3
|
export declare const defaultDocumentUploadConfig: DocumentUploadConfig;
|
|
4
4
|
declare const useDocumentUploadWithDefaultConfig: (conversationIdRef: import("vue").MaybeRef<string>) => import("./types").DocumentUploadReturn;
|
|
5
5
|
export { useDocumentUploadWithDefaultConfig, createDocumentUploadProvider };
|
|
6
|
-
export type { DocumentUploadConfig, DocumentUploadProvider };
|
|
6
|
+
export type { DocumentUploadConfig, DocumentUploadProvider, FileEntry, FileStatus, } from './types';
|
|
7
|
+
export { SdkError, defaultEndpoints } from './types';
|
|
7
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/composables/fileUpload/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/composables/fileUpload/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAItE,eAAO,MAAM,2BAA2B,EAAE,oBAsEzC,CAAC;AAEF,QAAA,MAA2B,kCAAkC,+FACF,CAAC;AAE5D,OAAO,EAAE,kCAAkC,EAAE,4BAA4B,EAAE,CAAC;AAE5E,YAAY,EACV,oBAAoB,EACpB,sBAAsB,EACtB,SAAS,EACT,UAAU,GACX,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -5,5 +5,5 @@ export { useConversationSessions } from './useConversationSessions';
|
|
|
5
5
|
export type { ConversationSession, MessageHandler, UseConversationSessionsReturn, } from './useConversationSessions';
|
|
6
6
|
export * from './types';
|
|
7
7
|
export { useDocumentUploadWithDefaultConfig, createDocumentUploadProvider, defaultDocumentUploadConfig, } from './fileUpload';
|
|
8
|
-
export type { DocumentUploadConfig, DocumentUploadProvider, } from './fileUpload';
|
|
8
|
+
export type { DocumentUploadConfig, DocumentUploadProvider, FileEntry, FileStatus, } from './fileUpload';
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/composables/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EACV,uBAAuB,EACvB,eAAe,EACf,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,YAAY,EACV,mBAAmB,EACnB,cAAc,EACd,6BAA6B,GAC9B,MAAM,2BAA2B,CAAC;AACnC,cAAc,SAAS,CAAC;AACxB,OAAO,EACL,kCAAkC,EAClC,4BAA4B,EAC5B,2BAA2B,GAC5B,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,oBAAoB,EACpB,sBAAsB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/composables/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EACV,uBAAuB,EACvB,eAAe,EACf,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,YAAY,EACV,mBAAmB,EACnB,cAAc,EACd,6BAA6B,GAC9B,MAAM,2BAA2B,CAAC;AACnC,cAAc,SAAS,CAAC;AACxB,OAAO,EACL,kCAAkC,EAClC,4BAA4B,EAC5B,2BAA2B,GAC5B,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,oBAAoB,EACpB,sBAAsB,EACtB,SAAS,EACT,UAAU,GACX,MAAM,cAAc,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { c, d, u,
|
|
1
|
+
import { c, d, u, b, e, f } from "../index-BLq6_Lt2.js";
|
|
2
2
|
export {
|
|
3
3
|
c as createDocumentUploadProvider,
|
|
4
4
|
d as defaultDocumentUploadConfig,
|
|
5
5
|
u as useChat,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
b as useConversationSessions,
|
|
7
|
+
e as useConversations,
|
|
8
|
+
f as useDocumentUploadWithDefaultConfig
|
|
9
9
|
};
|
|
@@ -1551,10 +1551,12 @@ const defaultDocumentUploadConfig = {
|
|
|
1551
1551
|
};
|
|
1552
1552
|
const { useDocumentUpload: useDocumentUploadWithDefaultConfig } = createDocumentUploadProvider(defaultDocumentUploadConfig);
|
|
1553
1553
|
export {
|
|
1554
|
-
|
|
1555
|
-
|
|
1554
|
+
SdkError as S,
|
|
1555
|
+
defaultEndpoints as a,
|
|
1556
|
+
useConversationSessions as b,
|
|
1556
1557
|
createDocumentUploadProvider as c,
|
|
1557
1558
|
defaultDocumentUploadConfig as d,
|
|
1558
|
-
|
|
1559
|
+
useConversations as e,
|
|
1560
|
+
useDocumentUploadWithDefaultConfig as f,
|
|
1559
1561
|
useChat as u
|
|
1560
1562
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export { type ChatConfig, type ChatMessage, type ChatResponse, type ConversationSummary, type HttpClient, type RawConversation, type RawConversationList, type StreamEvent, } from './services';
|
|
2
2
|
export { useMessageHandler, useMarkdownParser, provideChatKitLabels, useChatKitLabels, defaultChatKitLabels, CHAT_KIT_LABELS, } from './handlers';
|
|
3
3
|
export type { ChatKitLabels } from './handlers';
|
|
4
|
-
export { useChat, useConversationSessions, useConversations,
|
|
5
|
-
export type { ChatActions, ChatState, ConversationSession, CreateConversationInput,
|
|
4
|
+
export { useChat, useConversationSessions, useConversations, } from './composables';
|
|
5
|
+
export type { ChatActions, ChatState, ConversationSession, CreateConversationInput, MessageHandler, MutationOptions, UseChatReturn, UseConversationSessionsReturn, UseConversationsOptions, UseConversationsReturn, } from './composables';
|
|
6
|
+
export { SdkError, createDocumentUploadProvider, defaultDocumentUploadConfig, defaultEndpoints, useDocumentUploadWithDefaultConfig, } from './composables/fileUpload';
|
|
7
|
+
export type { DocumentUploadConfig, DocumentUploadProvider, FileEntry, FileStatus, } from './composables/fileUpload';
|
|
6
8
|
export { CkAgentMessage, CkConversation, CkConversationLayout, CkCopyMessageActionButton, CkFeedbackButton, CkHistory, CkHistoryItem, CkHistoryWrapper, CkInput, CkMarkdownRenderer, CkMessageActionButton, CkPromptActionButton, CkPromptStopButton, CkPromptInput, CkPromptInputDisclaimer, CkSendIcon, CkStopIcon, CkUserMessage, } from './components';
|
|
7
9
|
export type { CkConversationLayoutProps, CkConversationProps, CkFeedbackButtonProps, CkFeedbackValue, CkHistoryEmits, CkHistoryItemEmits, CkHistoryItemProps, CkHistoryProps, CkHistoryWrapperProps, CkMarkdownElementClasses, CkMarkdownRendererProps, CkUserMessageProps, } from './components';
|
|
8
10
|
export type { BaseMessage, Conversation, ConversationTree, MessageContent, MessageContentStatus, MessageReasoningContent, MessageRole, MessageStatus, MessageTextContent, MessageToolContent, TreeMessage, } from './types';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,WAAW,GACjB,MAAM,YAAY,CAAC;AASpB,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,GAChB,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGhD,OAAO,EACL,OAAO,EACP,uBAAuB,EACvB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,KAAK,eAAe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X,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,WAAW,GACZ,MAAM,SAAS,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { u } from "./useMessageHandler-ZRC-gIOJ.js";
|
|
2
2
|
import { C, d, p, u as u2, a } from "./useChatKitLabels-ftC52m7f.js";
|
|
3
|
-
import { c, d as d2,
|
|
4
|
-
import { _, a as a3, b as b2, C as C2, c as c2, d as d3, e as e2, f, g, h, i, j, k, l, m, n, o, p as p2 } from "./CkInput.vue_vue_type_script_setup_true_lang-C5C09u0z.js";
|
|
3
|
+
import { S, c, d as d2, a as a2, u as u3, b, e, f } from "./index-BLq6_Lt2.js";
|
|
4
|
+
import { _, a as a3, b as b2, C as C2, c as c2, d as d3, e as e2, f as f2, g, h, i, j, k, l, m, n, o, p as p2 } from "./CkInput.vue_vue_type_script_setup_true_lang-C5C09u0z.js";
|
|
5
5
|
export {
|
|
6
6
|
C as CHAT_KIT_LABELS,
|
|
7
7
|
_ as CkAgentMessage,
|
|
@@ -11,7 +11,7 @@ export {
|
|
|
11
11
|
c2 as CkFeedbackButton,
|
|
12
12
|
d3 as CkHistory,
|
|
13
13
|
e2 as CkHistoryItem,
|
|
14
|
-
|
|
14
|
+
f2 as CkHistoryWrapper,
|
|
15
15
|
g as CkInput,
|
|
16
16
|
h as CkMarkdownRenderer,
|
|
17
17
|
i as CkMessageActionButton,
|
|
@@ -22,15 +22,17 @@ export {
|
|
|
22
22
|
n as CkSendIcon,
|
|
23
23
|
o as CkStopIcon,
|
|
24
24
|
p2 as CkUserMessage,
|
|
25
|
+
S as SdkError,
|
|
25
26
|
c as createDocumentUploadProvider,
|
|
26
27
|
d as defaultChatKitLabels,
|
|
27
28
|
d2 as defaultDocumentUploadConfig,
|
|
29
|
+
a2 as defaultEndpoints,
|
|
28
30
|
p as provideChatKitLabels,
|
|
29
31
|
u3 as useChat,
|
|
30
32
|
u2 as useChatKitLabels,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
b as useConversationSessions,
|
|
34
|
+
e as useConversations,
|
|
35
|
+
f as useDocumentUploadWithDefaultConfig,
|
|
34
36
|
a as useMarkdownParser,
|
|
35
37
|
u as useMessageHandler
|
|
36
38
|
};
|
package/dist/types.d.ts
CHANGED
|
@@ -34,9 +34,10 @@ export interface MessageToolContent {
|
|
|
34
34
|
* Chain-of-thought / reasoning segment produced by the assistant. `text` is
|
|
35
35
|
* the (optional) human-readable trail — populated when the underlying
|
|
36
36
|
* transport exposes reasoning content (`REASONING_MESSAGE_CONTENT` deltas
|
|
37
|
-
* during a live run, `
|
|
38
|
-
*
|
|
39
|
-
*
|
|
37
|
+
* during a live run, `summary_text` parts under
|
|
38
|
+
* `ResponseOutputReasoning.summary` when re-hydrating from the Responses
|
|
39
|
+
* API). Surfaces that only need a "Thinking…" / "Thought" indicator can
|
|
40
|
+
* ignore it and rely on `status` alone.
|
|
40
41
|
*/
|
|
41
42
|
export interface MessageReasoningContent {
|
|
42
43
|
type: 'reasoning';
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAC;AAE1D,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,CAAC;AAE1E;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAAG,aAAa,GAAG,WAAW,GAAG,YAAY,CAAC;AAE9E;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,oBAAoB,CAAC;CAC9B;AAED;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,IAA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B;AAED,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,IAAI,EAAE,WAAW,CAAC;IAClB,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,MAAM,EAAE,aAAa,CAAC;IACtB,SAAS,EAAE,IAAI,CAAC;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IACnC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB"}
|
package/package.json
CHANGED
|
@@ -50,7 +50,8 @@ function reasoningOutput(id: string, text: string): ResponseOutputReasoning {
|
|
|
50
50
|
id,
|
|
51
51
|
status: 'completed',
|
|
52
52
|
role: null,
|
|
53
|
-
|
|
53
|
+
summary: [{ type: 'summary_text', text }],
|
|
54
|
+
content: null,
|
|
54
55
|
};
|
|
55
56
|
}
|
|
56
57
|
|
|
@@ -178,7 +179,6 @@ describe('responsesToTree', () => {
|
|
|
178
179
|
role: 'assistant',
|
|
179
180
|
content: [
|
|
180
181
|
{ type: 'output_text', text: 'first ' },
|
|
181
|
-
{ type: 'reasoning_summary', text: 'should-be-ignored' },
|
|
182
182
|
{ type: 'text', text: 'second' },
|
|
183
183
|
],
|
|
184
184
|
},
|
|
@@ -294,7 +294,7 @@ describe('responsesToTree', () => {
|
|
|
294
294
|
expect(assistant.content[1].type).toBe('tool');
|
|
295
295
|
});
|
|
296
296
|
|
|
297
|
-
it('omits reasoning text when no
|
|
297
|
+
it('omits reasoning text when no summary_text parts are present', () => {
|
|
298
298
|
const tree = responsesToTree([
|
|
299
299
|
makeResponse({
|
|
300
300
|
id: 'r1',
|
|
@@ -305,7 +305,8 @@ describe('responsesToTree', () => {
|
|
|
305
305
|
id: 'rs-empty',
|
|
306
306
|
status: 'completed',
|
|
307
307
|
role: null,
|
|
308
|
-
|
|
308
|
+
summary: [],
|
|
309
|
+
content: null,
|
|
309
310
|
},
|
|
310
311
|
assistantOutput('msg-a1', 'Hi'),
|
|
311
312
|
],
|
|
@@ -52,21 +52,27 @@ export interface ResponseOutputTextPart {
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
/**
|
|
55
|
-
* One reasoning fragment inside a `ResponseOutputReasoning`. The
|
|
56
|
-
* API
|
|
57
|
-
*
|
|
55
|
+
* One reasoning summary fragment inside a `ResponseOutputReasoning`. The
|
|
56
|
+
* Responses API exposes the human-readable chain-of-thought trail under
|
|
57
|
+
* `summary` as an array of `summary_text` parts; the body is surfaced for
|
|
58
|
+
* consumers that want to render it (chat-kit itself only surfaces a
|
|
58
59
|
* "thinking" indicator).
|
|
60
|
+
*
|
|
61
|
+
* This part shape is **specific to reasoning outputs** — it never appears
|
|
62
|
+
* mixed with `ResponseOutputTextPart` inside a `ResponseOutputMessage`.
|
|
59
63
|
*/
|
|
60
64
|
export interface ResponseReasoningTextPart {
|
|
61
|
-
type: '
|
|
65
|
+
type: 'summary_text';
|
|
62
66
|
text: string;
|
|
63
67
|
annotations?: ResponseAnnotation[];
|
|
64
68
|
}
|
|
65
69
|
|
|
66
70
|
/**
|
|
67
71
|
* Forward-compatible catch-all for content parts whose `type` chat-kit does
|
|
68
|
-
* not yet model (e.g. refusals, future part kinds
|
|
69
|
-
* `type` themselves when they need richer
|
|
72
|
+
* not yet model (e.g. refusals, future part kinds inside `unknown`-typed
|
|
73
|
+
* fields). Consumers narrow on `type` themselves when they need richer
|
|
74
|
+
* handling. Not used inside `ResponseOutputMessage` or
|
|
75
|
+
* `ResponseOutputReasoning`, whose content shapes are fixed.
|
|
70
76
|
*/
|
|
71
77
|
export interface ResponseUnknownContentPart {
|
|
72
78
|
type: string;
|
|
@@ -75,40 +81,37 @@ export interface ResponseUnknownContentPart {
|
|
|
75
81
|
[key: string]: unknown;
|
|
76
82
|
}
|
|
77
83
|
|
|
78
|
-
/**
|
|
79
|
-
* Discriminated union of content parts that can appear inside a Responses-
|
|
80
|
-
* API output item. `ResponseOutputTextPart` and `ResponseReasoningTextPart`
|
|
81
|
-
* cover the rendered shapes; the catch-all keeps the union open.
|
|
82
|
-
*/
|
|
83
|
-
export type OutputContentPart =
|
|
84
|
-
| ResponseOutputTextPart
|
|
85
|
-
| ResponseReasoningTextPart
|
|
86
|
-
| ResponseUnknownContentPart;
|
|
87
|
-
|
|
88
84
|
/**
|
|
89
85
|
* Visible message produced by a Responses-API turn (assistant reply or
|
|
90
86
|
* echoed user input). Carries the renderable text content; `responsesToTree`
|
|
91
|
-
* extracts text from `content` to build the chat tree.
|
|
87
|
+
* extracts text from `content` to build the chat tree. All entries are
|
|
88
|
+
* `ResponseOutputTextPart`s — no reasoning or unknown parts are mixed in.
|
|
92
89
|
*/
|
|
93
90
|
export interface ResponseOutputMessage {
|
|
94
91
|
type: 'message';
|
|
95
92
|
id: string;
|
|
96
93
|
status: string;
|
|
97
94
|
role: 'assistant' | 'user';
|
|
98
|
-
content:
|
|
95
|
+
content: ResponseOutputTextPart[];
|
|
99
96
|
}
|
|
100
97
|
|
|
101
98
|
/**
|
|
102
|
-
* Chain-of-thought trail produced by the assistant during a turn.
|
|
103
|
-
*
|
|
104
|
-
*
|
|
99
|
+
* Chain-of-thought trail produced by the assistant during a turn. The
|
|
100
|
+
* human-readable summary lives on `summary` as an array of
|
|
101
|
+
* `ResponseReasoningTextPart`s (all `summary_text`); `content` is reserved
|
|
102
|
+
* for the opaque/raw reasoning payload the API may attach and is kept
|
|
103
|
+
* `unknown` so consumers can downcast it on their own.
|
|
104
|
+
*
|
|
105
|
+
* Surfaced in chat-kit only as a "thinking" indicator; consumers may render
|
|
106
|
+
* the `summary` parts directly when desired.
|
|
105
107
|
*/
|
|
106
108
|
export interface ResponseOutputReasoning {
|
|
107
109
|
type: 'reasoning';
|
|
108
110
|
id: string;
|
|
109
111
|
status: string;
|
|
110
112
|
role?: 'assistant' | null;
|
|
111
|
-
|
|
113
|
+
summary: ResponseReasoningTextPart[];
|
|
114
|
+
content: unknown;
|
|
112
115
|
}
|
|
113
116
|
|
|
114
117
|
/**
|
|
@@ -233,12 +236,7 @@ interface ResponseMessageNode {
|
|
|
233
236
|
createdAt: Date;
|
|
234
237
|
}
|
|
235
238
|
|
|
236
|
-
function extractMessageText(
|
|
237
|
-
if (typeof content === 'string') return content.trim();
|
|
238
|
-
return extractTextFromParts(content);
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
function extractTextFromParts(parts: OutputContentPart[]): string {
|
|
239
|
+
function extractMessageText(parts: ResponseOutputTextPart[]): string {
|
|
242
240
|
let text = '';
|
|
243
241
|
for (const part of parts) {
|
|
244
242
|
if (part.type === 'output_text' || part.type === 'text') {
|
|
@@ -248,10 +246,10 @@ function extractTextFromParts(parts: OutputContentPart[]): string {
|
|
|
248
246
|
return text.trim();
|
|
249
247
|
}
|
|
250
248
|
|
|
251
|
-
function
|
|
249
|
+
function extractReasoningSummary(parts: ResponseReasoningTextPart[]): string {
|
|
252
250
|
let text = '';
|
|
253
251
|
for (const part of parts) {
|
|
254
|
-
if (part.type === '
|
|
252
|
+
if (part.type === 'summary_text') {
|
|
255
253
|
text += part.text ?? '';
|
|
256
254
|
}
|
|
257
255
|
}
|
|
@@ -271,7 +269,7 @@ function toAssistantParts(resp: StoredResponse): MessageContent[] {
|
|
|
271
269
|
for (const out of resp.output ?? []) {
|
|
272
270
|
switch (out.type) {
|
|
273
271
|
case 'reasoning': {
|
|
274
|
-
const text =
|
|
272
|
+
const text = extractReasoningSummary(out.summary ?? []);
|
|
275
273
|
parts.push({
|
|
276
274
|
type: 'reasoning',
|
|
277
275
|
id: out.id,
|
|
@@ -320,19 +318,35 @@ function getAssistantNodeId(resp: StoredResponse): string {
|
|
|
320
318
|
return `assistant-${resp.id}`;
|
|
321
319
|
}
|
|
322
320
|
|
|
323
|
-
//
|
|
324
|
-
//
|
|
325
|
-
//
|
|
326
|
-
//
|
|
327
|
-
//
|
|
321
|
+
// `request_input[].content` is wire-typed as `unknown` because user inputs
|
|
322
|
+
// can arrive as plain strings or as structured part arrays (e.g.
|
|
323
|
+
// `input_text`, `output_text`, `text`). We defensively pick up any
|
|
324
|
+
// text-bearing parts without relying on the strict output content shapes,
|
|
325
|
+
// which are reserved for `ResponseOutputMessage` / `ResponseOutputReasoning`.
|
|
328
326
|
function extractInputText(rawContent: unknown): string {
|
|
329
327
|
if (typeof rawContent === 'string') return rawContent.trim();
|
|
330
|
-
if (Array.isArray(rawContent))
|
|
331
|
-
|
|
328
|
+
if (!Array.isArray(rawContent)) return '';
|
|
329
|
+
let text = '';
|
|
330
|
+
for (const raw of rawContent) {
|
|
331
|
+
if (!raw || typeof raw !== 'object') continue;
|
|
332
|
+
const part = raw as { type?: unknown; text?: unknown };
|
|
333
|
+
if (
|
|
334
|
+
(part.type === 'input_text' ||
|
|
335
|
+
part.type === 'output_text' ||
|
|
336
|
+
part.type === 'text') &&
|
|
337
|
+
typeof part.text === 'string'
|
|
338
|
+
) {
|
|
339
|
+
text += part.text;
|
|
340
|
+
}
|
|
332
341
|
}
|
|
333
|
-
return
|
|
342
|
+
return text.trim();
|
|
334
343
|
}
|
|
335
344
|
|
|
345
|
+
// Within a single response, the visible messages chain linearly: every user
|
|
346
|
+
// input is followed by exactly one assistant turn (whose reasoning, tool,
|
|
347
|
+
// and text outputs are merged into one node). Across responses, branching
|
|
348
|
+
// is encoded by `previous_response_id` so several responses can share the
|
|
349
|
+
// same parent and form sibling subtrees.
|
|
336
350
|
function responseToMessageNodes(resp: StoredResponse): ResponseMessageNode[] {
|
|
337
351
|
const nodes: ResponseMessageNode[] = [];
|
|
338
352
|
if (resp.request_input) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DocumentUploadConfig
|
|
1
|
+
import type { DocumentUploadConfig } from './types';
|
|
2
2
|
import { createDocumentUploadProvider } from './useFileUploadWrapper';
|
|
3
3
|
|
|
4
4
|
const WORKFLOW_ID = 'my-doc-ai';
|
|
@@ -80,4 +80,10 @@ const { useDocumentUpload: useDocumentUploadWithDefaultConfig } =
|
|
|
80
80
|
|
|
81
81
|
export { useDocumentUploadWithDefaultConfig, createDocumentUploadProvider };
|
|
82
82
|
|
|
83
|
-
export type {
|
|
83
|
+
export type {
|
|
84
|
+
DocumentUploadConfig,
|
|
85
|
+
DocumentUploadProvider,
|
|
86
|
+
FileEntry,
|
|
87
|
+
FileStatus,
|
|
88
|
+
} from './types';
|
|
89
|
+
export { SdkError, defaultEndpoints } from './types';
|
package/src/composables/index.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -32,17 +32,12 @@ export {
|
|
|
32
32
|
useChat,
|
|
33
33
|
useConversationSessions,
|
|
34
34
|
useConversations,
|
|
35
|
-
useDocumentUploadWithDefaultConfig,
|
|
36
|
-
createDocumentUploadProvider,
|
|
37
|
-
defaultDocumentUploadConfig,
|
|
38
35
|
} from './composables';
|
|
39
36
|
export type {
|
|
40
37
|
ChatActions,
|
|
41
38
|
ChatState,
|
|
42
39
|
ConversationSession,
|
|
43
40
|
CreateConversationInput,
|
|
44
|
-
DocumentUploadConfig,
|
|
45
|
-
DocumentUploadProvider,
|
|
46
41
|
MessageHandler,
|
|
47
42
|
MutationOptions,
|
|
48
43
|
UseChatReturn,
|
|
@@ -51,6 +46,20 @@ export type {
|
|
|
51
46
|
UseConversationsReturn,
|
|
52
47
|
} from './composables';
|
|
53
48
|
|
|
49
|
+
export {
|
|
50
|
+
SdkError,
|
|
51
|
+
createDocumentUploadProvider,
|
|
52
|
+
defaultDocumentUploadConfig,
|
|
53
|
+
defaultEndpoints,
|
|
54
|
+
useDocumentUploadWithDefaultConfig,
|
|
55
|
+
} from './composables/fileUpload';
|
|
56
|
+
export type {
|
|
57
|
+
DocumentUploadConfig,
|
|
58
|
+
DocumentUploadProvider,
|
|
59
|
+
FileEntry,
|
|
60
|
+
FileStatus,
|
|
61
|
+
} from './composables/fileUpload';
|
|
62
|
+
|
|
54
63
|
// Components
|
|
55
64
|
export {
|
|
56
65
|
CkAgentMessage,
|
package/src/types.ts
CHANGED
|
@@ -40,9 +40,10 @@ export interface MessageToolContent {
|
|
|
40
40
|
* Chain-of-thought / reasoning segment produced by the assistant. `text` is
|
|
41
41
|
* the (optional) human-readable trail — populated when the underlying
|
|
42
42
|
* transport exposes reasoning content (`REASONING_MESSAGE_CONTENT` deltas
|
|
43
|
-
* during a live run, `
|
|
44
|
-
*
|
|
45
|
-
*
|
|
43
|
+
* during a live run, `summary_text` parts under
|
|
44
|
+
* `ResponseOutputReasoning.summary` when re-hydrating from the Responses
|
|
45
|
+
* API). Surfaces that only need a "Thinking…" / "Thought" indicator can
|
|
46
|
+
* ignore it and rely on `status` alone.
|
|
46
47
|
*/
|
|
47
48
|
export interface MessageReasoningContent {
|
|
48
49
|
type: 'reasoning';
|