elasticdash-sdk 0.2.8 → 0.2.9

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.
@@ -13,6 +13,34 @@ type UsageInfo = {
13
13
  outputTokens?: number;
14
14
  totalTokens?: number;
15
15
  };
16
+ /**
17
+ * Bedrock URL routes:
18
+ * POST /model/{modelId}/invoke
19
+ * POST /model/{modelId}/invoke-with-response-stream
20
+ * POST /model/{modelId}/converse
21
+ * POST /model/{modelId}/converse-stream
22
+ */
23
+ type BedrockApiKind = 'invoke' | 'invoke-stream' | 'converse' | 'converse-stream';
24
+ /** @internal — exported for tests only */
25
+ export declare function bedrockApiKind(url: string): BedrockApiKind | undefined;
26
+ /** @internal — exported for tests only */
27
+ export declare function extractBedrockModelId(url: string): string;
28
+ type BedrockVendor = 'anthropic' | 'amazon' | 'cohere' | 'meta' | 'mistral' | 'ai21' | 'stability' | 'unknown';
29
+ /** @internal — exported for tests only */
30
+ export declare function bedrockVendor(modelId: string): BedrockVendor;
31
+ interface BedrockFrame {
32
+ headers: Record<string, string>;
33
+ payload: Uint8Array;
34
+ }
35
+ /** @internal — exported for tests only */
36
+ export declare function parseBedrockEventStream(buf: Uint8Array): BedrockFrame[];
37
+ /** @internal — exported for tests only */
38
+ export declare function encodeBedrockFrame(eventType: string, payloadObj: Record<string, unknown>): Uint8Array;
39
+ /** @internal — exported for tests only */
40
+ export declare function bufferBedrockEventStream(url: string, stream: ReadableStream<Uint8Array>): Promise<{
41
+ completion: string;
42
+ usage?: UsageInfo;
43
+ }>;
16
44
  /**
17
45
  * Install the AI fetch interceptor. Wraps globalThis.fetch to automatically
18
46
  * record LLM steps into the active trace for OpenAI, Gemini, and Grok calls.
@@ -1 +1 @@
1
- {"version":3,"file":"ai-interceptor.d.ts","sourceRoot":"","sources":["../../src/interceptors/ai-interceptor.ts"],"names":[],"mappings":"AAqBA,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAA;IACX,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