@pitcher/js-api 1.22.0-beta.4 → 1.22.0-beta.5
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/js-api.esm.js +13 -1
- package/js-api.esm.js.map +1 -1
- package/js-api.umd.min.js +9 -9
- package/js-api.umd.min.js.map +1 -1
- package/lib/sdk/api/modules/ui/index.d.ts +1 -0
- package/lib/sdk/api/modules/ui/pia.ui.d.ts +11 -1
- package/lib/sdk/main.d.ts +3 -0
- package/lib/util/network.d.ts +1 -0
- package/package.json +1 -1
|
@@ -113,6 +113,7 @@ declare function onAppUpdateData(handler: (data: UiAppUpdateDataPayload) => Prom
|
|
|
113
113
|
*/
|
|
114
114
|
declare function uiBroadcast(payload: UiBroadcastRequest): Promise<void>;
|
|
115
115
|
declare const _default: {
|
|
116
|
+
promptPia(payload: import('../../../../main.lib').UiPromptPiaRequest): Promise<import('../../../../main.lib').UiPromptPiaResponse>;
|
|
116
117
|
completePostcall(payload: import('../../../../main.lib').UiCompletePostcallRequest): Promise<void>;
|
|
117
118
|
cancelMeeting(): Promise<void>;
|
|
118
119
|
resumeMeeting(): Promise<void>;
|
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
import { UiPromptPiaRequest, UiPromptPiaResponse } from './types.ui';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Sends a query to the Pitcher Intelligent Assistant (PIA) and handles the streamed response.
|
|
4
4
|
*
|
|
5
5
|
* @example
|
|
6
|
+
* // Subscribe to PIA's streamed responses
|
|
7
|
+
* const cleanup = await useUi().on(
|
|
8
|
+
* UI_MESSAGE_TYPES.UI_PROMPT_PIA_RESPONSE_STREAMED,
|
|
9
|
+
* async ({ chunk, partial_response }) => {
|
|
10
|
+
* console.log('PIA response chunk:', chunk);
|
|
11
|
+
* console.log('PIA partial response:', partial_response);
|
|
12
|
+
* }
|
|
13
|
+
* );
|
|
14
|
+
* // Prompt PIA with a question and ensure cleanup is called afterwards
|
|
6
15
|
* useUi().promptPia({ prompt: "What's my most presented file?" })
|
|
16
|
+
* .finally(cleanup);
|
|
7
17
|
*/
|
|
8
18
|
export declare function promptPia(payload: UiPromptPiaRequest): Promise<UiPromptPiaResponse>;
|
package/lib/sdk/main.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export declare function usePitcherApi(options?: ApiOptions): ReturnType<typeof c
|
|
|
24
24
|
* @returns UI API object with methods described below.
|
|
25
25
|
*/
|
|
26
26
|
export declare function useUi(): {
|
|
27
|
+
promptPia(payload: import('./api/modules/ui/types.ui').UiPromptPiaRequest): Promise<import('./api/modules/ui/types.ui').UiPromptPiaResponse>;
|
|
27
28
|
completePostcall(payload: import('./api/modules/ui/types.ui').UiCompletePostcallRequest): Promise<void>;
|
|
28
29
|
cancelMeeting(): Promise<void>;
|
|
29
30
|
resumeMeeting(): Promise<void>;
|
|
@@ -311,6 +312,7 @@ export declare function useApi(options?: ApiOptions): {
|
|
|
311
312
|
on: (type: typeof import('./api/modules/dsr/types.dsr').DSR_MESSAGE_TYPES[keyof typeof import('./api/modules/dsr/types.dsr').DSR_MESSAGE_TYPES], handler: (data: import('./api/modules/dsr/types.dsr').DsrMessagePayloads[typeof type]) => Promise<void>) => Promise<() => void>;
|
|
312
313
|
} | {
|
|
313
314
|
ui: {
|
|
315
|
+
promptPia(payload: import('./api/modules/ui/types.ui').UiPromptPiaRequest): Promise<import('./api/modules/ui/types.ui').UiPromptPiaResponse>;
|
|
314
316
|
completePostcall(payload: import('./api/modules/ui/types.ui').UiCompletePostcallRequest): Promise<void>;
|
|
315
317
|
cancelMeeting(): Promise<void>;
|
|
316
318
|
resumeMeeting(): Promise<void>;
|
|
@@ -476,6 +478,7 @@ export declare function useApi(options?: ApiOptions): {
|
|
|
476
478
|
openWebViewAlwaysOnTop(payload: import('./payload.types').OpenWebViewAlwaysOnTop): Promise<void>;
|
|
477
479
|
API: import('./api/LowLevelApi').LowLevelApi;
|
|
478
480
|
};
|
|
481
|
+
promptPia(payload: import('./api/modules/ui/types.ui').UiPromptPiaRequest): Promise<import('./api/modules/ui/types.ui').UiPromptPiaResponse>;
|
|
479
482
|
completePostcall(payload: import('./api/modules/ui/types.ui').UiCompletePostcallRequest): Promise<void>;
|
|
480
483
|
cancelMeeting(): Promise<void>;
|
|
481
484
|
resumeMeeting(): Promise<void>;
|
package/lib/util/network.d.ts
CHANGED
|
@@ -13,3 +13,4 @@ export declare function derivePatchRequestFields<T extends object>(current: T, u
|
|
|
13
13
|
updatedFields: string[];
|
|
14
14
|
payload: Partial<T>;
|
|
15
15
|
};
|
|
16
|
+
export declare function requestStream(url: string, body: Record<string, any>, token: string, onStreamedChunk?: (chunk: string, response: string) => void): Promise<string>;
|