@tarkahq/sdk 0.0.0-stage → 0.3.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.
Files changed (130) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +69 -0
  3. package/README.md +700 -2
  4. package/api-source.json +38 -0
  5. package/dist/cjs/client.d.ts +114 -0
  6. package/dist/cjs/client.js +174 -0
  7. package/dist/cjs/errors.d.ts +27 -0
  8. package/dist/cjs/errors.js +78 -0
  9. package/dist/cjs/generated/google/api/annotations.d.ts +1 -0
  10. package/dist/cjs/generated/google/api/annotations.js +10 -0
  11. package/dist/cjs/generated/google/api/http.d.ts +395 -0
  12. package/dist/cjs/generated/google/api/http.js +421 -0
  13. package/dist/cjs/generated/google/protobuf/descriptor.d.ts +873 -0
  14. package/dist/cjs/generated/google/protobuf/descriptor.js +3992 -0
  15. package/dist/cjs/generated/google/protobuf/empty.d.ts +35 -0
  16. package/dist/cjs/generated/google/protobuf/empty.js +58 -0
  17. package/dist/cjs/generated/google/protobuf/struct.d.ts +127 -0
  18. package/dist/cjs/generated/google/protobuf/struct.js +529 -0
  19. package/dist/cjs/generated/google/protobuf/timestamp.d.ts +128 -0
  20. package/dist/cjs/generated/google/protobuf/timestamp.js +95 -0
  21. package/dist/cjs/generated/protoc-gen-openapiv2/options/annotations.d.ts +1 -0
  22. package/dist/cjs/generated/protoc-gen-openapiv2/options/annotations.js +10 -0
  23. package/dist/cjs/generated/protoc-gen-openapiv2/options/openapiv2.d.ts +983 -0
  24. package/dist/cjs/generated/protoc-gen-openapiv2/options/openapiv2.js +4874 -0
  25. package/dist/cjs/generated/tarka/access/v1/access.d.ts +322 -0
  26. package/dist/cjs/generated/tarka/access/v1/access.js +2979 -0
  27. package/dist/cjs/generated/tarka/channels/v1/channels.d.ts +370 -0
  28. package/dist/cjs/generated/tarka/channels/v1/channels.js +3603 -0
  29. package/dist/cjs/generated/tarka/gateway/v1/gateway.d.ts +804 -0
  30. package/dist/cjs/generated/tarka/gateway/v1/gateway.js +8081 -0
  31. package/dist/cjs/generated/tarka/iam/v1/iam.d.ts +1291 -0
  32. package/dist/cjs/generated/tarka/iam/v1/iam.js +13207 -0
  33. package/dist/cjs/generated/tarka/inference/v1/inference.d.ts +699 -0
  34. package/dist/cjs/generated/tarka/inference/v1/inference.js +7058 -0
  35. package/dist/cjs/generated/tarka/provisioning/v1/agent_secrets.d.ts +70 -0
  36. package/dist/cjs/generated/tarka/provisioning/v1/agent_secrets.js +603 -0
  37. package/dist/cjs/generated/tarka/provisioning/v1/billing_quote.d.ts +171 -0
  38. package/dist/cjs/generated/tarka/provisioning/v1/billing_quote.js +1588 -0
  39. package/dist/cjs/generated/tarka/provisioning/v1/job.d.ts +168 -0
  40. package/dist/cjs/generated/tarka/provisioning/v1/job.js +1505 -0
  41. package/dist/cjs/generated/tarka/provisioning/v1/provisioning.d.ts +2644 -0
  42. package/dist/cjs/generated/tarka/provisioning/v1/provisioning.js +19501 -0
  43. package/dist/cjs/generated/tarka/provisioning/v1/registry_credentials.d.ts +89 -0
  44. package/dist/cjs/generated/tarka/provisioning/v1/registry_credentials.js +856 -0
  45. package/dist/cjs/generated/tarka/provisioning/v1/sandbox.d.ts +431 -0
  46. package/dist/cjs/generated/tarka/provisioning/v1/sandbox.js +3203 -0
  47. package/dist/cjs/generated/tarka/provisioning/v1/source_builds.d.ts +291 -0
  48. package/dist/cjs/generated/tarka/provisioning/v1/source_builds.js +3920 -0
  49. package/dist/cjs/grpc.d.ts +12 -0
  50. package/dist/cjs/grpc.js +55 -0
  51. package/dist/cjs/index.d.ts +6 -0
  52. package/dist/cjs/index.js +21 -0
  53. package/dist/cjs/package.json +1 -0
  54. package/dist/cjs/resources/inference.d.ts +293 -0
  55. package/dist/cjs/resources/inference.js +451 -0
  56. package/dist/cjs/resources/provisioning.d.ts +389 -0
  57. package/dist/cjs/resources/provisioning.js +552 -0
  58. package/dist/cjs/resources/sandboxes.d.ts +360 -0
  59. package/dist/cjs/resources/sandboxes.js +732 -0
  60. package/dist/cjs/rpc-types.d.ts +36 -0
  61. package/dist/cjs/rpc-types.js +29 -0
  62. package/dist/cjs/runtime.d.ts +99 -0
  63. package/dist/cjs/runtime.js +473 -0
  64. package/dist/cjs/transport.d.ts +60 -0
  65. package/dist/cjs/transport.js +114 -0
  66. package/dist/cjs/types.d.ts +309 -0
  67. package/dist/cjs/types.js +2 -0
  68. package/dist/esm/client.d.ts +114 -0
  69. package/dist/esm/client.js +169 -0
  70. package/dist/esm/errors.d.ts +27 -0
  71. package/dist/esm/errors.js +71 -0
  72. package/dist/esm/generated/google/api/annotations.d.ts +1 -0
  73. package/dist/esm/generated/google/api/annotations.js +7 -0
  74. package/dist/esm/generated/google/api/http.d.ts +395 -0
  75. package/dist/esm/generated/google/api/http.js +418 -0
  76. package/dist/esm/generated/google/protobuf/descriptor.d.ts +873 -0
  77. package/dist/esm/generated/google/protobuf/descriptor.js +3977 -0
  78. package/dist/esm/generated/google/protobuf/empty.d.ts +35 -0
  79. package/dist/esm/generated/google/protobuf/empty.js +55 -0
  80. package/dist/esm/generated/google/protobuf/struct.d.ts +127 -0
  81. package/dist/esm/generated/google/protobuf/struct.js +524 -0
  82. package/dist/esm/generated/google/protobuf/timestamp.d.ts +128 -0
  83. package/dist/esm/generated/google/protobuf/timestamp.js +92 -0
  84. package/dist/esm/generated/protoc-gen-openapiv2/options/annotations.d.ts +1 -0
  85. package/dist/esm/generated/protoc-gen-openapiv2/options/annotations.js +7 -0
  86. package/dist/esm/generated/protoc-gen-openapiv2/options/openapiv2.d.ts +983 -0
  87. package/dist/esm/generated/protoc-gen-openapiv2/options/openapiv2.js +4859 -0
  88. package/dist/esm/generated/tarka/access/v1/access.d.ts +322 -0
  89. package/dist/esm/generated/tarka/access/v1/access.js +2976 -0
  90. package/dist/esm/generated/tarka/channels/v1/channels.d.ts +370 -0
  91. package/dist/esm/generated/tarka/channels/v1/channels.js +3600 -0
  92. package/dist/esm/generated/tarka/gateway/v1/gateway.d.ts +804 -0
  93. package/dist/esm/generated/tarka/gateway/v1/gateway.js +8077 -0
  94. package/dist/esm/generated/tarka/iam/v1/iam.d.ts +1291 -0
  95. package/dist/esm/generated/tarka/iam/v1/iam.js +13203 -0
  96. package/dist/esm/generated/tarka/inference/v1/inference.d.ts +699 -0
  97. package/dist/esm/generated/tarka/inference/v1/inference.js +7055 -0
  98. package/dist/esm/generated/tarka/provisioning/v1/agent_secrets.d.ts +70 -0
  99. package/dist/esm/generated/tarka/provisioning/v1/agent_secrets.js +600 -0
  100. package/dist/esm/generated/tarka/provisioning/v1/billing_quote.d.ts +171 -0
  101. package/dist/esm/generated/tarka/provisioning/v1/billing_quote.js +1585 -0
  102. package/dist/esm/generated/tarka/provisioning/v1/job.d.ts +168 -0
  103. package/dist/esm/generated/tarka/provisioning/v1/job.js +1500 -0
  104. package/dist/esm/generated/tarka/provisioning/v1/provisioning.d.ts +2644 -0
  105. package/dist/esm/generated/tarka/provisioning/v1/provisioning.js +19496 -0
  106. package/dist/esm/generated/tarka/provisioning/v1/registry_credentials.d.ts +89 -0
  107. package/dist/esm/generated/tarka/provisioning/v1/registry_credentials.js +853 -0
  108. package/dist/esm/generated/tarka/provisioning/v1/sandbox.d.ts +431 -0
  109. package/dist/esm/generated/tarka/provisioning/v1/sandbox.js +3192 -0
  110. package/dist/esm/generated/tarka/provisioning/v1/source_builds.d.ts +291 -0
  111. package/dist/esm/generated/tarka/provisioning/v1/source_builds.js +3917 -0
  112. package/dist/esm/grpc.d.ts +12 -0
  113. package/dist/esm/grpc.js +11 -0
  114. package/dist/esm/index.d.ts +6 -0
  115. package/dist/esm/index.js +4 -0
  116. package/dist/esm/resources/inference.d.ts +293 -0
  117. package/dist/esm/resources/inference.js +437 -0
  118. package/dist/esm/resources/provisioning.d.ts +389 -0
  119. package/dist/esm/resources/provisioning.js +531 -0
  120. package/dist/esm/resources/sandboxes.d.ts +360 -0
  121. package/dist/esm/resources/sandboxes.js +718 -0
  122. package/dist/esm/rpc-types.d.ts +36 -0
  123. package/dist/esm/rpc-types.js +26 -0
  124. package/dist/esm/runtime.d.ts +99 -0
  125. package/dist/esm/runtime.js +466 -0
  126. package/dist/esm/transport.d.ts +60 -0
  127. package/dist/esm/transport.js +110 -0
  128. package/dist/esm/types.d.ts +309 -0
  129. package/dist/esm/types.js +1 -0
  130. package/package.json +155 -4
@@ -0,0 +1,12 @@
1
+ /** Low-level transport, service definitions and codecs for advanced integrations. */
2
+ export { createChannel, DEFAULT_GRPC_ENDPOINT, type ChannelConfig, } from "./client.js";
3
+ export { createServiceClient, type CallOptions, type ServiceClient, type ServiceDefinition, } from "./transport.js";
4
+ export type { GrpcClient, InferenceRpc, ProvisioningRpc, SandboxRpc, } from "./rpc-types.js";
5
+ export { Channel, ChannelCredentials, Metadata, credentials, status, type ChannelOptions, type ServiceError, } from "@grpc/grpc-js";
6
+ export * as inference from "./generated/tarka/inference/v1/inference.js";
7
+ export * as provisioning from "./generated/tarka/provisioning/v1/provisioning.js";
8
+ export * as sandboxes from "./generated/tarka/provisioning/v1/sandbox.js";
9
+ export * as iam from "./generated/tarka/iam/v1/iam.js";
10
+ export * as gateway from "./generated/tarka/gateway/v1/gateway.js";
11
+ export * as access from "./generated/tarka/access/v1/access.js";
12
+ export * as channels from "./generated/tarka/channels/v1/channels.js";
@@ -0,0 +1,11 @@
1
+ /** Low-level transport, service definitions and codecs for advanced integrations. */
2
+ export { createChannel, DEFAULT_GRPC_ENDPOINT, } from "./client.js";
3
+ export { createServiceClient, } from "./transport.js";
4
+ export { Channel, ChannelCredentials, Metadata, credentials, status, } from "@grpc/grpc-js";
5
+ export * as inference from "./generated/tarka/inference/v1/inference.js";
6
+ export * as provisioning from "./generated/tarka/provisioning/v1/provisioning.js";
7
+ export * as sandboxes from "./generated/tarka/provisioning/v1/sandbox.js";
8
+ export * as iam from "./generated/tarka/iam/v1/iam.js";
9
+ export * as gateway from "./generated/tarka/gateway/v1/gateway.js";
10
+ export * as access from "./generated/tarka/access/v1/access.js";
11
+ export * as channels from "./generated/tarka/channels/v1/channels.js";
@@ -0,0 +1,6 @@
1
+ export { TarkaClient, type TarkaClientOptions } from "./client.js";
2
+ export { TarkaError, type ErrorCode } from "./errors.js";
3
+ export type * from "./types.js";
4
+ export { Sandbox, SandboxTemplate, Execution, OperationError, SandboxOperationError, TemplateOperationError, ExecutionOperationError, ResourceStateError, type RecoveryDetails, } from "./resources/sandboxes.js";
5
+ export type { OrganizationScope } from "./resources/provisioning.js";
6
+ export { RuntimeClient, RuntimeMessage, RuntimeRun, RuntimeError, type RuntimeClientOptions, type RuntimeStart, type RuntimePermission, type RuntimeMetadata, } from "./runtime.js";
@@ -0,0 +1,4 @@
1
+ export { TarkaClient } from "./client.js";
2
+ export { TarkaError } from "./errors.js";
3
+ export { Sandbox, SandboxTemplate, Execution, OperationError, SandboxOperationError, TemplateOperationError, ExecutionOperationError, ResourceStateError, } from "./resources/sandboxes.js";
4
+ export { RuntimeClient, RuntimeMessage, RuntimeRun, RuntimeError, } from "./runtime.js";
@@ -0,0 +1,293 @@
1
+ import type { InferenceRpc, ProvisioningRpc } from "../rpc-types.js";
2
+ import type { RequestOptions, ChatInput, Model, CatalogModel, ChatCompletion, ChatChunk, JsonObject, ResponseEvent, OcrInput, OcrResult, OcrChunk, TranscriptionInput, TranslationInput, AudioText, SpeechInput, AudioData, VoiceInput, Voice } from "../types.js";
3
+ /** Inference model discovery. Access through `client.models`. */
4
+ export declare class Models {
5
+ #private;
6
+ constructor(rpc: InferenceRpc);
7
+ /**
8
+ * List the models visible to your inference credential.
9
+ *
10
+ * @returns Model records directly as an array.
11
+ * @example
12
+ * const models = await client.models.list();
13
+ * @param options - Per-call timeout in milliseconds, cancellation signal, and metadata.
14
+ */
15
+ list(options?: RequestOptions): Promise<Model[]>;
16
+ /**
17
+ * Retrieve one inference model.
18
+ *
19
+ * @param id - Model identifier or alias returned by `models.list()`.
20
+ * @param options - Per-call timeout in milliseconds, cancellation signal, and metadata.
21
+ */
22
+ get(id: string, options?: RequestOptions): Promise<Model>;
23
+ }
24
+ /** Control plane model catalog, including provisioning information. Access through `client.catalog`. */
25
+ export declare class Catalog {
26
+ #private;
27
+ constructor(rpc: ProvisioningRpc);
28
+ /**
29
+ * List catalog models, optionally filtered by modality.
30
+ *
31
+ * @param filter - Optional modality filter. Pass `undefined` when supplying only request settings.
32
+ * @returns Catalog records directly as an array; inference discovery is available through `client.models`.
33
+ * @param options - Per-call timeout in milliseconds, cancellation signal, and metadata.
34
+ */
35
+ list(filter?: {
36
+ modality?: string;
37
+ }, options?: RequestOptions): Promise<CatalogModel[]>;
38
+ }
39
+ /** OpenAI-compatible JSON chat. Access through `client.chat.json` when you need fields outside the typed chat API. */
40
+ export declare class JsonChat {
41
+ #private;
42
+ constructor(rpc: InferenceRpc);
43
+ /**
44
+ * Create a chat completion from an OpenAI-compatible JSON body.
45
+ *
46
+ * @param body - Ordinary JSON with OpenAI field names, such as `max_tokens`. The SDK sets `stream: false`.
47
+ * @returns The response body directly, without a `body` envelope.
48
+ * @param options - Per-call timeout in milliseconds, cancellation signal, and metadata.
49
+ */
50
+ create(body: JsonObject, options?: RequestOptions): Promise<JsonObject>;
51
+ /**
52
+ * Stream OpenAI-compatible JSON chat events.
53
+ *
54
+ * @param body - Ordinary JSON with OpenAI field names. The SDK sets `stream: true`.
55
+ * @returns A lazy iterable of `{ type, data }` events. Breaking iteration cancels the RPC.
56
+ * @param options - Per-call timeout in milliseconds, cancellation signal, and metadata.
57
+ */
58
+ stream(body: JsonObject, options?: RequestOptions): AsyncIterable<ResponseEvent>;
59
+ }
60
+ /** Typed chat completions and text helpers. Access through `client.chat`. */
61
+ export declare class Chat {
62
+ #private;
63
+ /** OpenAI-compatible JSON requests and events for fields outside the typed chat API. */
64
+ readonly json: JsonChat;
65
+ constructor(rpc: InferenceRpc);
66
+ /**
67
+ * Generate a full chat completion, including usage and tool calls.
68
+ *
69
+ * @param input - Model and either a text `prompt` with optional `system`, or a non-empty `messages` array.
70
+ * @returns The complete response. Use `text()` when you only need the first choice's text.
71
+ * @example
72
+ * const completion = await client.chat.create({ model, prompt: "Hello" });
73
+ * @param options - Per-call timeout in milliseconds, cancellation signal, and metadata.
74
+ */
75
+ create(input: ChatInput, options?: RequestOptions): Promise<ChatCompletion>;
76
+ /**
77
+ * Stream full chat chunks, including tool-call deltas and usage when provided.
78
+ *
79
+ * @param input - Model and a prompt or messages. Streaming is selected by this method.
80
+ * @returns A lazy iterable. Breaking iteration cancels the RPC; timeouts cover the whole stream.
81
+ * @param options - Per-call timeout in milliseconds, cancellation signal, and metadata.
82
+ */
83
+ stream(input: ChatInput, options?: RequestOptions): AsyncIterable<ChatChunk>;
84
+ /**
85
+ * Generate the text from choice 0 of a chat completion.
86
+ *
87
+ * @param input - Model and either a text `prompt` with optional `system`, or a non-empty `messages` array.
88
+ * @throws TarkaError with `failed_precondition` if choice 0 has no text. Use `create()` for tool calls or full results.
89
+ * @example
90
+ * const text = await client.chat.text({ model, prompt: "Say hello" });
91
+ * @param options - Per-call timeout in milliseconds, cancellation signal, and metadata.
92
+ */
93
+ text(input: ChatInput, options?: RequestOptions): Promise<string>;
94
+ /**
95
+ * Stream only non-empty text deltas from choice 0.
96
+ *
97
+ * Tool-call deltas and usage-only chunks are omitted. Use `stream()` to receive complete chunks.
98
+ * @param input - Model and a prompt or messages.
99
+ * @returns A lazy iterable of strings; breaking iteration cancels the RPC.
100
+ * @example
101
+ * for await (const text of client.chat.streamText({ model, prompt: "Hello" })) {
102
+ * process.stdout.write(text);
103
+ * }
104
+ * @param options - Per-call timeout in milliseconds, cancellation signal, and metadata.
105
+ */
106
+ streamText(input: ChatInput, options?: RequestOptions): AsyncIterable<string>;
107
+ }
108
+ /** OpenAI-compatible Responses API with unwrapped JSON results. Access through `client.responses`. */
109
+ export declare class Responses {
110
+ #private;
111
+ constructor(rpc: InferenceRpc);
112
+ /**
113
+ * Create a response and return its JSON body directly.
114
+ *
115
+ * @param body - OpenAI-compatible JSON with original field names. The SDK sets `stream: false`.
116
+ * @example
117
+ * const response = await client.responses.create({ model, input: "Hello" });
118
+ * @param options - Per-call timeout in milliseconds, cancellation signal, and metadata.
119
+ */
120
+ create(body: JsonObject, options?: RequestOptions): Promise<JsonObject>;
121
+ /**
122
+ * Stream response events as `{ type, data }`.
123
+ *
124
+ * @param body - OpenAI-compatible JSON. The SDK sets `stream: true`.
125
+ * @returns A lazy iterable. Breaking iteration cancels the RPC; a partial stream is never automatically replayed.
126
+ * @param options - Per-call timeout in milliseconds, cancellation signal, and metadata.
127
+ */
128
+ stream(body: JsonObject, options?: RequestOptions): AsyncIterable<ResponseEvent>;
129
+ /**
130
+ * Retrieve the JSON body of a stored response.
131
+ *
132
+ * @param id - Response identifier returned by creation.
133
+ * @param options - Per-call timeout in milliseconds, cancellation signal, and metadata.
134
+ */
135
+ get(id: string, options?: RequestOptions): Promise<JsonObject>;
136
+ /**
137
+ * Request cancellation of a response.
138
+ *
139
+ * @param id - Response identifier.
140
+ * @returns The updated response body.
141
+ * @param options - Per-call timeout in milliseconds, cancellation signal, and metadata.
142
+ */
143
+ cancel(id: string, options?: RequestOptions): Promise<JsonObject>;
144
+ /**
145
+ * Delete a stored response.
146
+ *
147
+ * @param id - Response identifier.
148
+ * @returns Resolves without a value after the server acknowledges deletion.
149
+ * @param options - Per-call timeout in milliseconds, cancellation signal, and metadata.
150
+ */
151
+ delete(id: string, options?: RequestOptions): Promise<void>;
152
+ }
153
+ /** Image text recognition and streaming. Access through `client.ocr`. */
154
+ export declare class Ocr {
155
+ #private;
156
+ constructor(rpc: InferenceRpc);
157
+ private request;
158
+ /**
159
+ * Recognize text and return the full OCR result.
160
+ *
161
+ * @param input - OCR model and either one `image` or a non-empty `images` array, in a format supported by the model.
162
+ * @param options - Per-call timeout in milliseconds, cancellation signal, and metadata.
163
+ */
164
+ create(input: OcrInput, options?: RequestOptions): Promise<OcrResult>;
165
+ /**
166
+ * Recognize text and return only the result's `text` field.
167
+ *
168
+ * @param input - OCR model and either `image` or `images`.
169
+ * @example
170
+ * const text = await client.ocr.text({ model, image: imageUrl });
171
+ * @param options - Per-call timeout in milliseconds, cancellation signal, and metadata.
172
+ */
173
+ text(input: OcrInput, options?: RequestOptions): Promise<string>;
174
+ /**
175
+ * Stream full OCR chunks.
176
+ *
177
+ * @param input - OCR model and either `image` or `images`.
178
+ * @returns A lazy iterable. Breaking iteration cancels the RPC.
179
+ * @param options - Per-call timeout in milliseconds, cancellation signal, and metadata.
180
+ */
181
+ stream(input: OcrInput, options?: RequestOptions): AsyncIterable<OcrChunk>;
182
+ /**
183
+ * Stream non-empty text fields from OCR chunks.
184
+ *
185
+ * @param input - OCR model and either `image` or `images`.
186
+ * @returns Text chunks in server order. Use `stream()` for the other result fields.
187
+ * @param options - Per-call timeout in milliseconds, cancellation signal, and metadata.
188
+ */
189
+ streamText(input: OcrInput, options?: RequestOptions): AsyncIterable<string>;
190
+ }
191
+ /** Speech-to-text transcription. Access through `client.audio.transcriptions`. */
192
+ export declare class Transcriptions {
193
+ #private;
194
+ constructor(rpc: InferenceRpc);
195
+ /**
196
+ * Transcribe audio and return the full text response, including metadata when provided.
197
+ *
198
+ * @param input - Transcription model, audio bytes as a Buffer, and optional filename, content type, and model settings.
199
+ * @param options - Per-call timeout in milliseconds, cancellation signal, and metadata.
200
+ */
201
+ create(input: TranscriptionInput, options?: RequestOptions): Promise<AudioText>;
202
+ /**
203
+ * Transcribe audio and return only the recognized text.
204
+ *
205
+ * @param input - Transcription model and audio bytes as a Buffer.
206
+ * @example
207
+ * const text = await client.audio.transcriptions.text({ model, file: audioBuffer });
208
+ * @param options - Per-call timeout in milliseconds, cancellation signal, and metadata.
209
+ */
210
+ text(input: TranscriptionInput, options?: RequestOptions): Promise<string>;
211
+ }
212
+ /** Audio translation. Access through `client.audio.translations`. */
213
+ export declare class Translations {
214
+ #private;
215
+ constructor(rpc: InferenceRpc);
216
+ /**
217
+ * Translate audio and return the full text response.
218
+ *
219
+ * @param input - Translation model, audio bytes as a Buffer, and optional file metadata and model settings.
220
+ * @param options - Per-call timeout in milliseconds, cancellation signal, and metadata.
221
+ */
222
+ create(input: TranslationInput, options?: RequestOptions): Promise<AudioText>;
223
+ /**
224
+ * Translate audio and return only the translated text.
225
+ *
226
+ * @param input - Translation model and audio bytes as a Buffer.
227
+ * @param options - Per-call timeout in milliseconds, cancellation signal, and metadata.
228
+ */
229
+ text(input: TranslationInput, options?: RequestOptions): Promise<string>;
230
+ }
231
+ /** Speech generation as a collected Buffer or a stream. Access through `client.audio.speech`. */
232
+ export declare class Speech {
233
+ #private;
234
+ constructor(rpc: InferenceRpc);
235
+ /**
236
+ * Generate speech as a stream of audio chunks.
237
+ *
238
+ * @param input - Speech model, text in `input`, and optional voice and output settings.
239
+ * @returns A lazy iterable of `{ data: Buffer, contentType }`. Breaking iteration cancels the RPC.
240
+ * @param options - Per-call timeout in milliseconds, cancellation signal, and metadata.
241
+ */
242
+ stream(input: SpeechInput, options?: RequestOptions): AsyncIterable<AudioData>;
243
+ /**
244
+ * Generate speech and collect all audio into one Buffer.
245
+ *
246
+ * @param input - Speech model, text in `input`, and optional voice and output settings.
247
+ * @returns `{ data: Buffer, contentType }`. Use `stream()` to avoid buffering a large response.
248
+ * @example
249
+ * const audio = await client.audio.speech.create({ model, input: "Hello" });
250
+ * @param options - Per-call timeout in milliseconds, cancellation signal, and metadata.
251
+ */
252
+ create(input: SpeechInput, options?: RequestOptions): Promise<AudioData>;
253
+ }
254
+ /** Voice cloning with explicit consent metadata. Access through `client.audio.voices`. */
255
+ export declare class Voices {
256
+ #private;
257
+ constructor(rpc: InferenceRpc);
258
+ /**
259
+ * Create a voice clone from an audio sample and consent information.
260
+ *
261
+ * @param input - Model, voice name, sample Buffer, consent signer and date, plus optional file metadata.
262
+ * @returns The created voice record; inspect its `status` for the server-reported state.
263
+ * @param options - Per-call timeout in milliseconds, cancellation signal, and metadata.
264
+ */
265
+ create(input: VoiceInput, options?: RequestOptions): Promise<Voice>;
266
+ /**
267
+ * Retrieve a voice clone and its current state.
268
+ *
269
+ * @param id - Voice identifier.
270
+ * @param options - Per-call timeout in milliseconds, cancellation signal, and metadata.
271
+ */
272
+ get(id: string, options?: RequestOptions): Promise<Voice>;
273
+ /**
274
+ * Delete a voice clone.
275
+ *
276
+ * @param id - Voice identifier.
277
+ * @returns Resolves without a value after acknowledgement.
278
+ * @param options - Per-call timeout in milliseconds, cancellation signal, and metadata.
279
+ */
280
+ delete(id: string, options?: RequestOptions): Promise<void>;
281
+ }
282
+ /** Audio transcription, translation, generation, and voice cloning. Access through `client.audio`. */
283
+ export declare class Audio {
284
+ /** Transcribe audio into text, with full-result and text-only methods. */
285
+ readonly transcriptions: Transcriptions;
286
+ /** Translate audio into text, with full-result and text-only methods. */
287
+ readonly translations: Translations;
288
+ /** Generate audio as a collected Buffer or a stream of chunks. */
289
+ readonly speech: Speech;
290
+ /** Create, retrieve, and delete voice clones. */
291
+ readonly voices: Voices;
292
+ constructor(rpc: InferenceRpc);
293
+ }