@umituz/web-ai 1.0.2 → 1.0.3
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/{text-generation.service-CcYQM6Ch.d.ts → cancellation-error-CKcZRhFg.d.ts} +64 -1
- package/dist/{text-generation.service-BQO3Tvz2.d.cts → cancellation-error-DwHrDKBz.d.cts} +64 -1
- package/dist/content/index.cjs +798 -27
- package/dist/content/index.cjs.map +1 -1
- package/dist/content/index.js +798 -27
- package/dist/content/index.js.map +1 -1
- package/dist/hooks/index.cjs +922 -31
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.cts +38 -2
- package/dist/hooks/index.d.ts +38 -2
- package/dist/hooks/index.js +919 -32
- package/dist/hooks/index.js.map +1 -1
- package/dist/index.cjs +809 -27
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +800 -28
- package/dist/index.js.map +1 -1
- package/dist/providers/index.cjs +809 -27
- package/dist/providers/index.cjs.map +1 -1
- package/dist/providers/index.d.cts +43 -3
- package/dist/providers/index.d.ts +43 -3
- package/dist/providers/index.js +800 -28
- package/dist/providers/index.js.map +1 -1
- package/package.json +6 -1
|
@@ -6,8 +6,8 @@ import { h as AnthropicProviderConfig, e as AnthropicEffort, x as AnthropicMessa
|
|
|
6
6
|
export { A as AIProviderConfig, a as ANTHROPIC_API_VERSION, b as ANTHROPIC_DEFAULT_MAX_TOKENS, c as ANTHROPIC_MODELS, d as ANTHROPIC_TIERS, j as AnthropicStreamEvent, G as GroqChatChunk, m as GroqChoice, n as GroqChunkChoice, o as GroqConfig, p as GroqErrorResponse, v as GroqUsage, w as createAI } from '../create-ai-CXYKPK6G.cjs';
|
|
7
7
|
import { b as CacheStats } from '../cache-manager-Df9LLYGA.cjs';
|
|
8
8
|
import { b as RetryManager, a as RequestQueue, R as RequestDeduplicator } from '../request-deduplicator.util-NDo0_n1y.cjs';
|
|
9
|
-
import {
|
|
10
|
-
export { I as IGroqChatService, S as StreamingCallbacks,
|
|
9
|
+
import { b as IGroqHttpClient, l as TextGenerationService, a as GenerationStage, f as PrunaModelId, h as PrunaPredictionResponse, n as TextToVideoInput, G as GenerateOptions, j as PrunaResult, e as PrunaInput } from '../cancellation-error-DwHrDKBz.cjs';
|
|
10
|
+
export { C as CancellationError, I as IGroqChatService, c as ImageToImageInput, d as ImageToVideoInput, P as PrunaAspectRatio, g as PrunaOutput, i as PrunaResolution, S as StreamingCallbacks, k as StructuredGenerationOptions, T as TextGenerationOptions, m as TextToImageInput } from '../cancellation-error-DwHrDKBz.cjs';
|
|
11
11
|
import { d as ChatService } from '../chat.service-CL1qtYxe.cjs';
|
|
12
12
|
import { c as GeminiConfig, I as ImageGenerationRequest, G as GeneratedContent, V as VideoGenerationRequest, a as ImageToVideoRequest, b as VideoToVideoRequest, F as FalConfig, P as PrunaConfig } from '../ProviderConfig-DIFa9nmG.cjs';
|
|
13
13
|
|
|
@@ -362,9 +362,49 @@ declare class FalProvider extends BaseProvider implements IMediaProvider {
|
|
|
362
362
|
}
|
|
363
363
|
declare function createFalProvider(config: FalConfig): FalProvider;
|
|
364
364
|
|
|
365
|
+
declare class AuthenticationError extends Error {
|
|
366
|
+
constructor(message?: string);
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
declare class TimeoutError extends Error {
|
|
370
|
+
constructor(message?: string);
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
interface ValidationErrorContext {
|
|
374
|
+
field: string;
|
|
375
|
+
reason: string;
|
|
376
|
+
receivedValue?: unknown;
|
|
377
|
+
}
|
|
378
|
+
declare class ValidationError extends Error {
|
|
379
|
+
readonly field: string;
|
|
380
|
+
readonly reason: string;
|
|
381
|
+
readonly receivedValue: unknown;
|
|
382
|
+
constructor(context: ValidationErrorContext);
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
declare function uploadImage(base64OrUrl: string, apiKey: string, onProgress?: (stage: GenerationStage) => void): Promise<string>;
|
|
386
|
+
declare function submitPrediction(model: PrunaModelId, input: Record<string, unknown>, apiKey: string, signal?: AbortSignal, onProgress?: (stage: GenerationStage) => void): Promise<PrunaPredictionResponse>;
|
|
387
|
+
declare class GenerationFailedError extends Error {
|
|
388
|
+
constructor(message: string);
|
|
389
|
+
}
|
|
390
|
+
declare function pollForResult(pollUrl: string, apiKey: string, maxAttempts?: number, intervalMs?: number, signal?: AbortSignal, onProgress?: (stage: GenerationStage, attempt: number) => void): Promise<string>;
|
|
391
|
+
|
|
392
|
+
declare function generate(apiKey: string, input: PrunaInput, options?: GenerateOptions & {
|
|
393
|
+
useCache?: boolean;
|
|
394
|
+
}): Promise<PrunaResult>;
|
|
395
|
+
declare function generateImageThenVideo(apiKey: string, input: TextToVideoInput, options?: GenerateOptions): Promise<PrunaResult>;
|
|
396
|
+
|
|
365
397
|
interface PrunaRequest {
|
|
366
398
|
model?: string;
|
|
367
399
|
image?: string;
|
|
400
|
+
prompt?: string;
|
|
401
|
+
quality?: string;
|
|
402
|
+
duration?: number;
|
|
403
|
+
aspectRatio?: string;
|
|
404
|
+
aspect_ratio?: string;
|
|
405
|
+
motion?: number | string;
|
|
406
|
+
resolution?: string;
|
|
407
|
+
seed?: number;
|
|
368
408
|
[key: string]: unknown;
|
|
369
409
|
}
|
|
370
410
|
interface PrunaProgressStage {
|
|
@@ -396,4 +436,4 @@ declare class PrunaProvider implements IMediaProvider {
|
|
|
396
436
|
}
|
|
397
437
|
declare function createPrunaProvider(config: PrunaConfig): PrunaProvider;
|
|
398
438
|
|
|
399
|
-
export { API_ENDPOINTS, AnthropicEffort, AnthropicHttpTransport, AnthropicMessagesRequest, AnthropicMessagesResponse, AnthropicProvider, AnthropicProviderConfig, AnthropicRequestBuilder, AnthropicStopReason, type AppContainer, BaseProvider, type BaseProviderConfig, CostEstimateRequest, DEFAULT_BASE_URL, DEFAULT_GENERATION_CONFIG, DEFAULT_MODELS, FalProvider, GEMINI_TIERS, GROQ_MODELS, GROQ_TIERS, GeminiProvider, GroqChatRequest, GroqChatRequestBuilder, GroqChatResponse, GroqConfigStore, GroqGenerationConfig, GroqHttpClient, type GroqHttpClientDeps, GroqHttpTransport, GroqMessage, GroqMessageRole, GroqProvider, GroqProviderConfig, GroqReasoningEffort, IGroqHttpClient, IMediaProvider, ITextProvider, ProviderError, type PrunaProgressStage, PrunaProvider, type PrunaRequest, StreamRequestOptions$1 as StreamRequestOptions, type StructuredJsonRequest, TIMEOUTS, TextGenerationService, configureProvider, consumeAnthropicStream, consumeGroqStream, createAssistantMessage, createFalProvider, createGeminiProvider, createMessage, createPrunaProvider, createSystemMessage, createUserMessage, defaultEffortForModel, extractContentFromSsePayload, extractTextFromMessages, formatMessagesForDisplay, generateWithPruna, getProvider, mapAnthropicStopReason, promptToMessages, requestStructuredJson, resetProvider, toGroqMessages };
|
|
439
|
+
export { API_ENDPOINTS, AnthropicEffort, AnthropicHttpTransport, AnthropicMessagesRequest, AnthropicMessagesResponse, AnthropicProvider, AnthropicProviderConfig, AnthropicRequestBuilder, AnthropicStopReason, type AppContainer, AuthenticationError, BaseProvider, type BaseProviderConfig, CostEstimateRequest, DEFAULT_BASE_URL, DEFAULT_GENERATION_CONFIG, DEFAULT_MODELS, FalProvider, GEMINI_TIERS, GROQ_MODELS, GROQ_TIERS, GeminiProvider, GenerateOptions, GenerationFailedError, GenerationStage, GroqChatRequest, GroqChatRequestBuilder, GroqChatResponse, GroqConfigStore, GroqGenerationConfig, GroqHttpClient, type GroqHttpClientDeps, GroqHttpTransport, GroqMessage, GroqMessageRole, GroqProvider, GroqProviderConfig, GroqReasoningEffort, IGroqHttpClient, IMediaProvider, ITextProvider, ProviderError, PrunaInput, PrunaModelId, PrunaPredictionResponse, type PrunaProgressStage, PrunaProvider, type PrunaRequest, PrunaResult, StreamRequestOptions$1 as StreamRequestOptions, type StructuredJsonRequest, TIMEOUTS, TextGenerationService, TextToVideoInput, TimeoutError, ValidationError, configureProvider, consumeAnthropicStream, consumeGroqStream, createAssistantMessage, createFalProvider, createGeminiProvider, createMessage, createPrunaProvider, createSystemMessage, createUserMessage, defaultEffortForModel, extractContentFromSsePayload, extractTextFromMessages, formatMessagesForDisplay, generateImageThenVideo, generate as generatePruna, generateWithPruna, getProvider, mapAnthropicStopReason, pollForResult, promptToMessages, requestStructuredJson, resetProvider, submitPrediction, toGroqMessages, uploadImage };
|
|
@@ -6,8 +6,8 @@ import { h as AnthropicProviderConfig, e as AnthropicEffort, x as AnthropicMessa
|
|
|
6
6
|
export { A as AIProviderConfig, a as ANTHROPIC_API_VERSION, b as ANTHROPIC_DEFAULT_MAX_TOKENS, c as ANTHROPIC_MODELS, d as ANTHROPIC_TIERS, j as AnthropicStreamEvent, G as GroqChatChunk, m as GroqChoice, n as GroqChunkChoice, o as GroqConfig, p as GroqErrorResponse, v as GroqUsage, w as createAI } from '../create-ai-9PW752z8.js';
|
|
7
7
|
import { b as CacheStats } from '../cache-manager-Df9LLYGA.js';
|
|
8
8
|
import { b as RetryManager, a as RequestQueue, R as RequestDeduplicator } from '../request-deduplicator.util-NDo0_n1y.js';
|
|
9
|
-
import {
|
|
10
|
-
export { I as IGroqChatService, S as StreamingCallbacks,
|
|
9
|
+
import { b as IGroqHttpClient, l as TextGenerationService, a as GenerationStage, f as PrunaModelId, h as PrunaPredictionResponse, n as TextToVideoInput, G as GenerateOptions, j as PrunaResult, e as PrunaInput } from '../cancellation-error-CKcZRhFg.js';
|
|
10
|
+
export { C as CancellationError, I as IGroqChatService, c as ImageToImageInput, d as ImageToVideoInput, P as PrunaAspectRatio, g as PrunaOutput, i as PrunaResolution, S as StreamingCallbacks, k as StructuredGenerationOptions, T as TextGenerationOptions, m as TextToImageInput } from '../cancellation-error-CKcZRhFg.js';
|
|
11
11
|
import { d as ChatService } from '../chat.service-q05GnhEm.js';
|
|
12
12
|
import { c as GeminiConfig, I as ImageGenerationRequest, G as GeneratedContent, V as VideoGenerationRequest, a as ImageToVideoRequest, b as VideoToVideoRequest, F as FalConfig, P as PrunaConfig } from '../ProviderConfig-DIFa9nmG.js';
|
|
13
13
|
|
|
@@ -362,9 +362,49 @@ declare class FalProvider extends BaseProvider implements IMediaProvider {
|
|
|
362
362
|
}
|
|
363
363
|
declare function createFalProvider(config: FalConfig): FalProvider;
|
|
364
364
|
|
|
365
|
+
declare class AuthenticationError extends Error {
|
|
366
|
+
constructor(message?: string);
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
declare class TimeoutError extends Error {
|
|
370
|
+
constructor(message?: string);
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
interface ValidationErrorContext {
|
|
374
|
+
field: string;
|
|
375
|
+
reason: string;
|
|
376
|
+
receivedValue?: unknown;
|
|
377
|
+
}
|
|
378
|
+
declare class ValidationError extends Error {
|
|
379
|
+
readonly field: string;
|
|
380
|
+
readonly reason: string;
|
|
381
|
+
readonly receivedValue: unknown;
|
|
382
|
+
constructor(context: ValidationErrorContext);
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
declare function uploadImage(base64OrUrl: string, apiKey: string, onProgress?: (stage: GenerationStage) => void): Promise<string>;
|
|
386
|
+
declare function submitPrediction(model: PrunaModelId, input: Record<string, unknown>, apiKey: string, signal?: AbortSignal, onProgress?: (stage: GenerationStage) => void): Promise<PrunaPredictionResponse>;
|
|
387
|
+
declare class GenerationFailedError extends Error {
|
|
388
|
+
constructor(message: string);
|
|
389
|
+
}
|
|
390
|
+
declare function pollForResult(pollUrl: string, apiKey: string, maxAttempts?: number, intervalMs?: number, signal?: AbortSignal, onProgress?: (stage: GenerationStage, attempt: number) => void): Promise<string>;
|
|
391
|
+
|
|
392
|
+
declare function generate(apiKey: string, input: PrunaInput, options?: GenerateOptions & {
|
|
393
|
+
useCache?: boolean;
|
|
394
|
+
}): Promise<PrunaResult>;
|
|
395
|
+
declare function generateImageThenVideo(apiKey: string, input: TextToVideoInput, options?: GenerateOptions): Promise<PrunaResult>;
|
|
396
|
+
|
|
365
397
|
interface PrunaRequest {
|
|
366
398
|
model?: string;
|
|
367
399
|
image?: string;
|
|
400
|
+
prompt?: string;
|
|
401
|
+
quality?: string;
|
|
402
|
+
duration?: number;
|
|
403
|
+
aspectRatio?: string;
|
|
404
|
+
aspect_ratio?: string;
|
|
405
|
+
motion?: number | string;
|
|
406
|
+
resolution?: string;
|
|
407
|
+
seed?: number;
|
|
368
408
|
[key: string]: unknown;
|
|
369
409
|
}
|
|
370
410
|
interface PrunaProgressStage {
|
|
@@ -396,4 +436,4 @@ declare class PrunaProvider implements IMediaProvider {
|
|
|
396
436
|
}
|
|
397
437
|
declare function createPrunaProvider(config: PrunaConfig): PrunaProvider;
|
|
398
438
|
|
|
399
|
-
export { API_ENDPOINTS, AnthropicEffort, AnthropicHttpTransport, AnthropicMessagesRequest, AnthropicMessagesResponse, AnthropicProvider, AnthropicProviderConfig, AnthropicRequestBuilder, AnthropicStopReason, type AppContainer, BaseProvider, type BaseProviderConfig, CostEstimateRequest, DEFAULT_BASE_URL, DEFAULT_GENERATION_CONFIG, DEFAULT_MODELS, FalProvider, GEMINI_TIERS, GROQ_MODELS, GROQ_TIERS, GeminiProvider, GroqChatRequest, GroqChatRequestBuilder, GroqChatResponse, GroqConfigStore, GroqGenerationConfig, GroqHttpClient, type GroqHttpClientDeps, GroqHttpTransport, GroqMessage, GroqMessageRole, GroqProvider, GroqProviderConfig, GroqReasoningEffort, IGroqHttpClient, IMediaProvider, ITextProvider, ProviderError, type PrunaProgressStage, PrunaProvider, type PrunaRequest, StreamRequestOptions$1 as StreamRequestOptions, type StructuredJsonRequest, TIMEOUTS, TextGenerationService, configureProvider, consumeAnthropicStream, consumeGroqStream, createAssistantMessage, createFalProvider, createGeminiProvider, createMessage, createPrunaProvider, createSystemMessage, createUserMessage, defaultEffortForModel, extractContentFromSsePayload, extractTextFromMessages, formatMessagesForDisplay, generateWithPruna, getProvider, mapAnthropicStopReason, promptToMessages, requestStructuredJson, resetProvider, toGroqMessages };
|
|
439
|
+
export { API_ENDPOINTS, AnthropicEffort, AnthropicHttpTransport, AnthropicMessagesRequest, AnthropicMessagesResponse, AnthropicProvider, AnthropicProviderConfig, AnthropicRequestBuilder, AnthropicStopReason, type AppContainer, AuthenticationError, BaseProvider, type BaseProviderConfig, CostEstimateRequest, DEFAULT_BASE_URL, DEFAULT_GENERATION_CONFIG, DEFAULT_MODELS, FalProvider, GEMINI_TIERS, GROQ_MODELS, GROQ_TIERS, GeminiProvider, GenerateOptions, GenerationFailedError, GenerationStage, GroqChatRequest, GroqChatRequestBuilder, GroqChatResponse, GroqConfigStore, GroqGenerationConfig, GroqHttpClient, type GroqHttpClientDeps, GroqHttpTransport, GroqMessage, GroqMessageRole, GroqProvider, GroqProviderConfig, GroqReasoningEffort, IGroqHttpClient, IMediaProvider, ITextProvider, ProviderError, PrunaInput, PrunaModelId, PrunaPredictionResponse, type PrunaProgressStage, PrunaProvider, type PrunaRequest, PrunaResult, StreamRequestOptions$1 as StreamRequestOptions, type StructuredJsonRequest, TIMEOUTS, TextGenerationService, TextToVideoInput, TimeoutError, ValidationError, configureProvider, consumeAnthropicStream, consumeGroqStream, createAssistantMessage, createFalProvider, createGeminiProvider, createMessage, createPrunaProvider, createSystemMessage, createUserMessage, defaultEffortForModel, extractContentFromSsePayload, extractTextFromMessages, formatMessagesForDisplay, generateImageThenVideo, generate as generatePruna, generateWithPruna, getProvider, mapAnthropicStopReason, pollForResult, promptToMessages, requestStructuredJson, resetProvider, submitPrediction, toGroqMessages, uploadImage };
|