@meetploy/types 1.12.0 → 1.13.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/ai.d.ts +41 -0
- package/dist/ai.js +2 -0
- package/dist/ai.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/globals.d.ts +5 -0
- package/package.json +1 -1
package/dist/ai.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
type AiGatewayMetadataValue = number | string | boolean | null;
|
|
2
|
+
export interface AiGatewayRetries {
|
|
3
|
+
maxAttempts?: 1 | 2 | 3 | 4 | 5;
|
|
4
|
+
retryDelayMs?: number;
|
|
5
|
+
backoff?: "constant" | "linear" | "exponential";
|
|
6
|
+
}
|
|
7
|
+
export interface AiGatewayOptions {
|
|
8
|
+
id: string;
|
|
9
|
+
cacheKey?: string;
|
|
10
|
+
cacheTtl?: number;
|
|
11
|
+
skipCache?: boolean;
|
|
12
|
+
metadata?: Record<string, AiGatewayMetadataValue>;
|
|
13
|
+
collectLog?: boolean;
|
|
14
|
+
eventId?: string;
|
|
15
|
+
requestTimeoutMs?: number;
|
|
16
|
+
retries?: AiGatewayRetries;
|
|
17
|
+
}
|
|
18
|
+
export interface AiRunOptions {
|
|
19
|
+
queueRequest?: boolean;
|
|
20
|
+
websocket?: boolean;
|
|
21
|
+
tags?: string[];
|
|
22
|
+
gateway?: AiGatewayOptions;
|
|
23
|
+
returnRawResponse?: boolean;
|
|
24
|
+
prefix?: string;
|
|
25
|
+
extraHeaders?: Record<string, string>;
|
|
26
|
+
}
|
|
27
|
+
export interface AiGateway {
|
|
28
|
+
run: (request: unknown | unknown[]) => Promise<Response>;
|
|
29
|
+
}
|
|
30
|
+
export interface Ai {
|
|
31
|
+
aiGatewayLogId: string | null;
|
|
32
|
+
gateway: (gatewayId: string) => AiGateway;
|
|
33
|
+
run: ((model: string, inputs: Record<string, unknown> & {
|
|
34
|
+
stream: true;
|
|
35
|
+
}, options?: AiRunOptions) => Promise<ReadableStream>) & ((model: string, inputs: Record<string, unknown>, options: AiRunOptions & ({
|
|
36
|
+
returnRawResponse: true;
|
|
37
|
+
} | {
|
|
38
|
+
websocket: true;
|
|
39
|
+
})) => Promise<Response>) & (<T = unknown>(model: string, inputs: Record<string, unknown>, options?: AiRunOptions) => Promise<T>);
|
|
40
|
+
}
|
|
41
|
+
export {};
|
package/dist/ai.js
ADDED
package/dist/ai.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai.js","sourceRoot":"","sources":["../src/ai.ts"],"names":[],"mappings":""}
|
package/dist/index.d.ts
CHANGED
|
@@ -8,3 +8,4 @@ export type { StateBinding, StateUpdateDoc } from "./state.js";
|
|
|
8
8
|
export type { FileStorageBinding, FileStorageObject, FileStorageKey, FileStorageListResult, FileStoragePutOptions, FileStorageListOptions, } from "./fs.js";
|
|
9
9
|
export type { ScheduledEvent, ScheduledHandler } from "./scheduled.js";
|
|
10
10
|
export type { PloyAuth, PloyUser } from "./auth.js";
|
|
11
|
+
export type { Ai, AiGateway, AiGatewayOptions, AiGatewayRetries, AiRunOptions, } from "./ai.js";
|
package/globals.d.ts
CHANGED
|
@@ -30,6 +30,11 @@ declare global {
|
|
|
30
30
|
type TimerBinding = import("@meetploy/types").TimerBinding;
|
|
31
31
|
type PloyAuth = import("@meetploy/types").PloyAuth;
|
|
32
32
|
type PloyUser = import("@meetploy/types").PloyUser;
|
|
33
|
+
type Ai = import("@meetploy/types").Ai;
|
|
34
|
+
type AiGateway = import("@meetploy/types").AiGateway;
|
|
35
|
+
type AiGatewayOptions = import("@meetploy/types").AiGatewayOptions;
|
|
36
|
+
type AiGatewayRetries = import("@meetploy/types").AiGatewayRetries;
|
|
37
|
+
type AiRunOptions = import("@meetploy/types").AiRunOptions;
|
|
33
38
|
|
|
34
39
|
// --- Handler and context types ---
|
|
35
40
|
type WorkflowContext<
|