@squidcloud/client 1.0.370 → 1.0.371
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.
|
@@ -93,16 +93,18 @@ export declare class AiAgentReference {
|
|
|
93
93
|
* Sends a prompt to the agent and receives streamed text responses.
|
|
94
94
|
* @param prompt The text prompt to send to the agent.
|
|
95
95
|
* @param options Optional parameters for the AI ask request.
|
|
96
|
-
* @param jobId Optional
|
|
97
|
-
* `squid.jobs().getJob(jobId)
|
|
96
|
+
* @param jobId (Optional) A unique identifier for this request. Use it with `squid.jobs().awaitJob(jobId)` or
|
|
97
|
+
* `squid.jobs().getJob(jobId)` to track progress. Make sure each job ID is both unique and kept private—anyone who
|
|
98
|
+
* knows it can look up the job’s status.
|
|
98
99
|
*/
|
|
99
100
|
chat<T extends AiChatModelName | undefined>(prompt: string, options?: AiChatOptionsWithoutVoice<T>, jobId?: JobId): Observable<string>;
|
|
100
101
|
/**
|
|
101
102
|
* Transcribes the given file and performs a chat interaction.
|
|
102
103
|
* @param fileToTranscribe The audio file to transcribe and send to the agent.
|
|
103
104
|
* @param options Optional parameters for the AI ask request.
|
|
104
|
-
* @param jobId Optional
|
|
105
|
-
* `squid.jobs().getJob(jobId)
|
|
105
|
+
* @param jobId (Optional) A unique identifier for this request. Use it with `squid.jobs().awaitJob(jobId)` or
|
|
106
|
+
* `squid.jobs().getJob(jobId)` to track progress. Make sure each job ID is both unique and kept private—anyone who
|
|
107
|
+
* knows it can look up the job’s status.
|
|
106
108
|
*/
|
|
107
109
|
transcribeAndChat(fileToTranscribe: File, options?: AiChatOptionsWithoutVoice, jobId?: JobId): Promise<TranscribeAndChatResponse>;
|
|
108
110
|
/**
|
|
@@ -113,10 +115,21 @@ export declare class AiAgentReference {
|
|
|
113
115
|
* Sends a prompt and receives a full string response.
|
|
114
116
|
* @param prompt The text prompt to send to the agent.
|
|
115
117
|
* @param options Optional parameters for the AI ask request.
|
|
116
|
-
* @param jobId Optional
|
|
117
|
-
* `squid.jobs().getJob(jobId)
|
|
118
|
+
* @param jobId (Optional) A unique identifier for this request. Use it with `squid.jobs().awaitJob(jobId)` or
|
|
119
|
+
* `squid.jobs().getJob(jobId)` to track progress. Make sure each job ID is both unique and kept private—anyone who
|
|
120
|
+
* knows it can look up the job’s status.
|
|
118
121
|
*/
|
|
119
122
|
ask<T extends AiChatModelName | undefined = undefined>(prompt: string, options?: AiAskOptions<T>, jobId?: JobId): Promise<string>;
|
|
123
|
+
/**
|
|
124
|
+
* Sends a prompt and not wait for the result - the result can be tracked using the job ID
|
|
125
|
+
* (`squid.jobs().awaitJob(jobId)` or `squid.jobs().getJob(jobId)).
|
|
126
|
+
* @param prompt The text prompt to send to the agent.
|
|
127
|
+
* @param jobId A unique identifier for this request. Use it with `squid.jobs().awaitJob(jobId)` or
|
|
128
|
+
* `squid.jobs().getJob(jobId)`
|
|
129
|
+
to track progress. Make sure each job ID is both unique and kept private—anyone who knows it can look up the job’s status.
|
|
130
|
+
* @param options Optional parameters for the AI ask request.
|
|
131
|
+
*/
|
|
132
|
+
askAsync<T extends AiChatModelName | undefined = undefined>(prompt: string, jobId: JobId, options?: AiAskOptions<T>): Promise<void>;
|
|
120
133
|
/**
|
|
121
134
|
* Observes live status messages from the agent.
|
|
122
135
|
*/
|
|
@@ -125,24 +138,27 @@ export declare class AiAgentReference {
|
|
|
125
138
|
* Transcribes audio and sends it to the agent for response.
|
|
126
139
|
* @param fileToTranscribe The audio file to transcribe and send to the agent.
|
|
127
140
|
* @param options Optional parameters for the AI ask request.
|
|
128
|
-
* @param jobId Optional
|
|
129
|
-
* `squid.jobs().getJob(jobId)
|
|
141
|
+
* @param jobId (Optional) A unique identifier for this request. Use it with `squid.jobs().awaitJob(jobId)` or
|
|
142
|
+
* `squid.jobs().getJob(jobId)` to track progress. Make sure each job ID is both unique and kept private—anyone who
|
|
143
|
+
* knows it can look up the job’s status.
|
|
130
144
|
*/
|
|
131
145
|
transcribeAndAsk<T extends AiChatModelName | undefined>(fileToTranscribe: File, options?: AiAskOptions<T>, jobId?: JobId): Promise<AiTranscribeAndAskResponse>;
|
|
132
146
|
/**
|
|
133
147
|
* Transcribes audio and gets both text and voice response from the agent.
|
|
134
148
|
* @param fileToTranscribe The audio file to transcribe and send to the agent.
|
|
135
149
|
* @param options Optional parameters for the AI ask request.
|
|
136
|
-
* @param jobId Optional
|
|
137
|
-
* `squid.jobs().getJob(jobId)
|
|
150
|
+
* @param jobId (Optional) A unique identifier for this request. Use it with `squid.jobs().awaitJob(jobId)` or
|
|
151
|
+
* `squid.jobs().getJob(jobId)` to track progress. Make sure each job ID is both unique and kept private—anyone who
|
|
152
|
+
* knows it can look up the job’s status.
|
|
138
153
|
*/
|
|
139
154
|
transcribeAndAskWithVoiceResponse<T extends AiChatModelName | undefined>(fileToTranscribe: File, options?: AiAskOptionsWithVoice<T>, jobId?: JobId): Promise<TranscribeAndAskWithVoiceResponse>;
|
|
140
155
|
/**
|
|
141
156
|
* Sends a prompt and gets both text and voice response from the agent.
|
|
142
157
|
* @param prompt The text prompt to send to the agent.
|
|
143
158
|
* @param options Optional parameters for the AI ask request.
|
|
144
|
-
* @param jobId Optional
|
|
145
|
-
* `squid.jobs().getJob(jobId)
|
|
159
|
+
* @param jobId (Optional) A unique identifier for this request. Use it with `squid.jobs().awaitJob(jobId)` or
|
|
160
|
+
* `squid.jobs().getJob(jobId)` to track progress. Make sure each job ID is both unique and kept private—anyone who
|
|
161
|
+
* knows it can look up the job’s status.
|
|
146
162
|
*/
|
|
147
163
|
askWithVoiceResponse<T extends AiChatModelName | undefined>(prompt: string, options?: AiAskOptionsWithVoice<T>, jobId?: JobId): Promise<AskWithVoiceResponse>;
|
|
148
164
|
private askInternal;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { AsyncJob, JobId } from '../../internal-common/src/public-types/job.public-types';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Handles job subscriptions and notifications.
|
|
4
|
+
*
|
|
5
|
+
* **Important:** Each `jobId` must be globally unique and kept private.
|
|
6
|
+
* Anyone who knows a job’s ID can query its status or result.
|
|
4
7
|
*/
|
|
5
8
|
export declare class JobClient {
|
|
6
9
|
private readonly socketManager;
|
|
@@ -8,13 +11,20 @@ export declare class JobClient {
|
|
|
8
11
|
private isListening;
|
|
9
12
|
private readonly listeners;
|
|
10
13
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
14
|
+
* Retrieves the current status (and, if completed, the result) of a job.
|
|
15
|
+
*
|
|
16
|
+
* @param jobId A unique, private identifier for the job.
|
|
17
|
+
* Do **not** reuse a `jobId` across clients—possessing the ID
|
|
18
|
+
* allows anyone to inspect the job’s state.
|
|
13
19
|
*/
|
|
14
20
|
getJob<T = any>(jobId: JobId): Promise<AsyncJob<T> | undefined>;
|
|
15
21
|
/**
|
|
16
|
-
* Waits
|
|
17
|
-
*
|
|
22
|
+
* Waits until the specified job finishes, then resolves with its result or
|
|
23
|
+
* throws if the job fails.
|
|
24
|
+
*
|
|
25
|
+
* @param jobId A unique, private identifier for the job.
|
|
26
|
+
* Do **not** reuse a `jobId` across clients—possessing the ID
|
|
27
|
+
* allows anyone to inspect the job’s state.
|
|
18
28
|
*/
|
|
19
29
|
awaitJob<T = any>(jobId: JobId): Promise<T>;
|
|
20
30
|
private maybeListenToJobs;
|