needle-cloud 1.10.3-dev.1455a0e → 1.10.3-dev.2679141
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/cli.esm.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/web/functions/chat.d.ts +20 -3
- package/package.json +1 -1
|
@@ -38,20 +38,20 @@ export function readChat(slug: string, opts?: {
|
|
|
38
38
|
* @overload
|
|
39
39
|
* @param {string} slug
|
|
40
40
|
* @param {string} message
|
|
41
|
-
* @param {{ org?: string, stream?: false, source?: string, personal?: boolean, full_url?: string, pathname?: string }} [opts]
|
|
41
|
+
* @param {{ org?: string, stream?: false, source?: string, personal?: boolean, full_url?: string, pathname?: string, client_tools?: import("@needle-tools/cloud-sdk/types/api.ai").ClientToolDefinition[], context?: import("@needle-tools/cloud-sdk/types/api.ai").ClientContext[] }} [opts]
|
|
42
42
|
* @returns {Promise<import("@needle-tools/cloud-sdk/types/api.ai").AIChatSyncResponse>}
|
|
43
43
|
*/
|
|
44
44
|
/**
|
|
45
45
|
* @overload
|
|
46
46
|
* @param {string} slug
|
|
47
47
|
* @param {string} message
|
|
48
|
-
* @param {{ org?: string, stream: true, source?: string, personal?: boolean, full_url?: string, pathname?: string }} opts
|
|
48
|
+
* @param {{ org?: string, stream: true, source?: string, personal?: boolean, full_url?: string, pathname?: string, client_tools?: import("@needle-tools/cloud-sdk/types/api.ai").ClientToolDefinition[], context?: import("@needle-tools/cloud-sdk/types/api.ai").ClientContext[] }} opts
|
|
49
49
|
* @returns {Promise<AsyncGenerator<import("@needle-tools/cloud-sdk/types/api.ai").ChatStreamEvent>>}
|
|
50
50
|
*/
|
|
51
51
|
/**
|
|
52
52
|
* @param {string} slug
|
|
53
53
|
* @param {string} message
|
|
54
|
-
* @param {{ org?: string, stream?: boolean, source?: string, personal?: boolean, full_url?: string, pathname?: string }} [opts]
|
|
54
|
+
* @param {{ org?: string, stream?: boolean, source?: string, personal?: boolean, full_url?: string, pathname?: string, client_tools?: import("@needle-tools/cloud-sdk/types/api.ai").ClientToolDefinition[], context?: import("@needle-tools/cloud-sdk/types/api.ai").ClientContext[] }} [opts]
|
|
55
55
|
* @returns {Promise<import("@needle-tools/cloud-sdk/types/api.ai").AIChatSyncResponse | AsyncGenerator<import("@needle-tools/cloud-sdk/types/api.ai").ChatStreamEvent>>}
|
|
56
56
|
*/
|
|
57
57
|
export function sendChatMessage(slug: string, message: string, opts?: {
|
|
@@ -61,6 +61,8 @@ export function sendChatMessage(slug: string, message: string, opts?: {
|
|
|
61
61
|
personal?: boolean;
|
|
62
62
|
full_url?: string;
|
|
63
63
|
pathname?: string;
|
|
64
|
+
client_tools?: import("@needle-tools/cloud-sdk/types/api.ai").ClientToolDefinition[];
|
|
65
|
+
context?: import("@needle-tools/cloud-sdk/types/api.ai").ClientContext[];
|
|
64
66
|
}): Promise<import("@needle-tools/cloud-sdk/types/api.ai").AIChatSyncResponse | AsyncGenerator<import("@needle-tools/cloud-sdk/types/api.ai").ChatStreamEvent>>;
|
|
65
67
|
/**
|
|
66
68
|
* Interrupt an active AI generation for the given chat slug.
|
|
@@ -72,3 +74,18 @@ export function interruptChat(slug: string, opts?: {
|
|
|
72
74
|
org?: string;
|
|
73
75
|
personal?: boolean;
|
|
74
76
|
}): Promise<void>;
|
|
77
|
+
/**
|
|
78
|
+
* Submit a client-side tool execution result back to the server.
|
|
79
|
+
* Call this when you receive a `client_tool_request` event from the SSE stream.
|
|
80
|
+
* @param {string} requestId - The `request_id` from the `client_tool_request` event
|
|
81
|
+
* @param {{ result?: any, error?: string }} outcome - The tool result or error
|
|
82
|
+
* @param {{ org?: string, personal?: boolean }} [opts]
|
|
83
|
+
* @returns {Promise<void>}
|
|
84
|
+
*/
|
|
85
|
+
export function submitToolResult(requestId: string, outcome: {
|
|
86
|
+
result?: any;
|
|
87
|
+
error?: string;
|
|
88
|
+
}, opts?: {
|
|
89
|
+
org?: string;
|
|
90
|
+
personal?: boolean;
|
|
91
|
+
}): Promise<void>;
|