@umituz/web-ai 1.0.9 → 1.0.10
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/{AIErrors-CSk4nvN1.d.ts → AIErrors-TuSFl--T.d.ts} +1 -1
- package/dist/{AIErrors-Dq9o95R_.d.cts → AIErrors-_IyXRWj1.d.cts} +1 -1
- package/dist/{cancellation-error-CpkPd67D.d.cts → cancellation-error-_39nYWwz.d.cts} +3 -3
- package/dist/{cancellation-error-Ci8fQhNF.d.ts → cancellation-error-hYcE9AS9.d.ts} +3 -3
- package/dist/chat/index.d.cts +4 -4
- package/dist/chat/index.d.ts +4 -4
- package/dist/{chat.service-BRtiA7H9.d.cts → chat.service-8MaW9pum.d.cts} +2 -2
- package/dist/{chat.service-Cqga2h1e.d.ts → chat.service-B4Isrckn.d.ts} +2 -2
- package/dist/content/index.d.cts +7 -7
- package/dist/content/index.d.ts +7 -7
- package/dist/core/index.cjs +6 -4
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +7 -26
- package/dist/core/index.d.ts +7 -26
- package/dist/core/index.js +6 -4
- package/dist/core/index.js.map +1 -1
- package/dist/{create-ai-DW7eHMBF.d.ts → create-ai-D-oEWzf9.d.ts} +3 -3
- package/dist/{create-ai-DeOpUgZ-.d.cts → create-ai-DRysRImc.d.cts} +3 -3
- package/dist/hooks/index.d.cts +9 -9
- package/dist/hooks/index.d.ts +9 -9
- package/dist/{index-Ca5o4gBK.d.ts → index-1e91KRYU.d.ts} +1 -1
- package/dist/{index-itgxPeLz.d.cts → index-Dv8gRzAu.d.cts} +1 -1
- package/dist/{index-DDzvTDg0.d.ts → index-OhvYUTXf.d.cts} +1 -2
- package/dist/{index-DDzvTDg0.d.cts → index-OhvYUTXf.d.ts} +1 -2
- package/dist/index.cjs +305 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -11
- package/dist/index.d.ts +11 -11
- package/dist/index.js +304 -5
- package/dist/index.js.map +1 -1
- package/dist/{provider.factory-CJuI08Xr.d.ts → provider.factory-B9RNUTYj.d.ts} +1 -1
- package/dist/{provider.factory-DG2CYFgh.d.cts → provider.factory-Ce6Een1G.d.cts} +1 -1
- package/dist/providers/index.cjs +381 -0
- package/dist/providers/index.cjs.map +1 -1
- package/dist/providers/index.d.cts +61 -11
- package/dist/providers/index.d.ts +61 -11
- package/dist/providers/index.js +380 -1
- package/dist/providers/index.js.map +1 -1
- package/dist/{requestQueue-D-RCbxuR.d.ts → requestQueue-AP6n_bRH.d.ts} +4 -4
- package/dist/{requestQueue-O6f8VBl5.d.cts → requestQueue-D89wx91Q.d.cts} +4 -4
- package/dist/{request-deduplicator.util-NDo0_n1y.d.cts → tool-call-accumulator-C7KhaXZA.d.cts} +20 -1
- package/dist/{request-deduplicator.util-NDo0_n1y.d.ts → tool-call-accumulator-C7KhaXZA.d.ts} +20 -1
- package/package.json +1 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { C as CostEstimateRequest, d as ITextProvider, a as IMediaProvider } from '../provider.factory-
|
|
2
|
-
export { A as AnyProvider, I as IAIProvider, b as IProviderBase, P as ProviderCapability, e as ProviderFactory, f as ProviderFactoryConfig, g as createProviderFactory, i as isMediaProvider, h as isTextProvider } from '../provider.factory-
|
|
3
|
-
import { P as ProviderHealth, b as TextTier, T as TextRequest, G as GenerationResult, a as StructuredTextRequest, S as StructuredGeneration, d as StreamCallbacks, F as FinishReason, C as ChatMessage, c as TokenUsage } from '../index-
|
|
4
|
-
import { A as AIError, c as TierModelMap } from '../index-
|
|
5
|
-
import { h as AnthropicProviderConfig, e as AnthropicEffort, x as AnthropicMessage, f as AnthropicMessagesRequest, i as AnthropicStopReason, g as AnthropicMessagesResponse, t as GroqProviderConfig, r as GroqMessage, q as GroqGenerationConfig, k as GroqChatRequest, l as GroqChatResponse, S as StreamRequestOptions$1, s as GroqMessageRole, u as GroqReasoningEffort } from '../create-ai-
|
|
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-
|
|
1
|
+
import { C as CostEstimateRequest, d as ITextProvider, a as IMediaProvider } from '../provider.factory-Ce6Een1G.cjs';
|
|
2
|
+
export { A as AnyProvider, I as IAIProvider, b as IProviderBase, P as ProviderCapability, e as ProviderFactory, f as ProviderFactoryConfig, g as createProviderFactory, i as isMediaProvider, h as isTextProvider } from '../provider.factory-Ce6Een1G.cjs';
|
|
3
|
+
import { P as ProviderHealth, b as TextTier, T as TextRequest, G as GenerationResult, a as StructuredTextRequest, S as StructuredGeneration, d as StreamCallbacks, F as FinishReason, C as ChatMessage, c as TokenUsage } from '../index-OhvYUTXf.cjs';
|
|
4
|
+
import { A as AIError, c as TierModelMap } from '../index-Dv8gRzAu.cjs';
|
|
5
|
+
import { h as AnthropicProviderConfig, e as AnthropicEffort, x as AnthropicMessage, f as AnthropicMessagesRequest, i as AnthropicStopReason, g as AnthropicMessagesResponse, t as GroqProviderConfig, r as GroqMessage, q as GroqGenerationConfig, k as GroqChatRequest, l as GroqChatResponse, S as StreamRequestOptions$1, s as GroqMessageRole, u as GroqReasoningEffort } from '../create-ai-DRysRImc.cjs';
|
|
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-DRysRImc.cjs';
|
|
7
7
|
import { b as CacheStats } from '../cache-manager-Df9LLYGA.cjs';
|
|
8
|
-
import { b as RetryManager, a as RequestQueue, R as RequestDeduplicator } from '../
|
|
9
|
-
import { b as IGroqHttpClient, T as TextGenerationService, a as GenerationStage, f as PrunaModelId, h as PrunaPredictionResponse, m as TextToVideoInput, G as GenerateOptions, j as PrunaResult, e as PrunaInput } from '../cancellation-error-
|
|
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, n as TextGenerationOptions, l as TextToImageInput } from '../cancellation-error-
|
|
11
|
-
import { d as ChatService } from '../chat.service-
|
|
8
|
+
import { b as RetryManager, a as RequestQueue, R as RequestDeduplicator, A as AssistantToolCall } from '../tool-call-accumulator-C7KhaXZA.cjs';
|
|
9
|
+
import { b as IGroqHttpClient, T as TextGenerationService, a as GenerationStage, f as PrunaModelId, h as PrunaPredictionResponse, m as TextToVideoInput, G as GenerateOptions, j as PrunaResult, e as PrunaInput } from '../cancellation-error-_39nYWwz.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, n as TextGenerationOptions, l as TextToImageInput } from '../cancellation-error-_39nYWwz.cjs';
|
|
11
|
+
import { d as ChatService } from '../chat.service-8MaW9pum.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
|
|
|
14
14
|
interface BaseProviderConfig {
|
|
@@ -507,4 +507,54 @@ type ImageQuality = (typeof IMAGE_QUALITIES)[number];
|
|
|
507
507
|
declare const IMAGE_B64_LIMIT = 12000000;
|
|
508
508
|
declare function createOpenAiImageAdapter(config: OpenAiCompatibleConfig): ImageAdapter;
|
|
509
509
|
|
|
510
|
-
|
|
510
|
+
type AdapterChatRole = 'system' | 'user' | 'assistant' | 'tool';
|
|
511
|
+
interface AdapterChatMessage {
|
|
512
|
+
readonly role: AdapterChatRole;
|
|
513
|
+
readonly content: string;
|
|
514
|
+
readonly toolCalls?: readonly AssistantToolCall[];
|
|
515
|
+
readonly toolCallId?: string;
|
|
516
|
+
}
|
|
517
|
+
interface RequestImage {
|
|
518
|
+
readonly mimeType: string;
|
|
519
|
+
readonly dataBase64: string;
|
|
520
|
+
}
|
|
521
|
+
interface ToolDefinition {
|
|
522
|
+
readonly name: string;
|
|
523
|
+
readonly description: string;
|
|
524
|
+
readonly parameters: Record<string, unknown>;
|
|
525
|
+
}
|
|
526
|
+
interface AdapterRequest {
|
|
527
|
+
readonly externalModelId: string;
|
|
528
|
+
readonly messages: readonly AdapterChatMessage[];
|
|
529
|
+
readonly temperature: number;
|
|
530
|
+
readonly maxOutputTokens: number;
|
|
531
|
+
readonly topP: number;
|
|
532
|
+
readonly tools?: readonly ToolDefinition[];
|
|
533
|
+
readonly images?: readonly RequestImage[];
|
|
534
|
+
readonly signal?: AbortSignal;
|
|
535
|
+
}
|
|
536
|
+
type ProviderEvent = {
|
|
537
|
+
readonly type: 'delta';
|
|
538
|
+
readonly channel: 'answer' | 'reasoning';
|
|
539
|
+
readonly text: string;
|
|
540
|
+
} | {
|
|
541
|
+
readonly type: 'usage';
|
|
542
|
+
readonly usage: TokenUsage;
|
|
543
|
+
} | {
|
|
544
|
+
readonly type: 'tool_calls';
|
|
545
|
+
readonly calls: readonly AssistantToolCall[];
|
|
546
|
+
};
|
|
547
|
+
interface ChatAdapter {
|
|
548
|
+
stream(req: AdapterRequest): AsyncIterable<ProviderEvent>;
|
|
549
|
+
}
|
|
550
|
+
interface AdapterConfig {
|
|
551
|
+
readonly baseUrl: string;
|
|
552
|
+
readonly apiKey: string;
|
|
553
|
+
readonly timeoutMs: number;
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
declare function createOpenAiCompatibleAdapter(config: AdapterConfig): ChatAdapter;
|
|
557
|
+
|
|
558
|
+
declare function createAnthropicAdapter(config: AdapterConfig): ChatAdapter;
|
|
559
|
+
|
|
560
|
+
export { API_ENDPOINTS, type AdapterChatMessage, type AdapterChatRole, type AdapterConfig, type AdapterRequest, AnthropicEffort, AnthropicHttpTransport, AnthropicMessagesRequest, AnthropicMessagesResponse, AnthropicProvider, AnthropicProviderConfig, AnthropicRequestBuilder, AnthropicStopReason, type AppContainer, type AudioTranscriptionAdapter, type AudioTranscriptionRequest, type AudioTranscriptionResult, AuthenticationError, BaseProvider as BaseAIProvider, BaseProvider, type BaseProviderConfig, type ChatAdapter, CostEstimateRequest, DEFAULT_BASE_URL, DEFAULT_GENERATION_CONFIG, DEFAULT_MODELS, type EmbeddingsAdapter, type EmbeddingsRequest, type EmbeddingsResult, 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, IMAGE_B64_LIMIT, IMAGE_QUALITIES, IMAGE_SIZES, IMediaProvider, ITextProvider, type ImageAdapter, type ImageQuality, type ImageRequest, type ImageResult, type ImageSize, type OpenAiCompatibleConfig, ProviderError, type ProviderEvent, PrunaInput, PrunaModelId, PrunaPredictionResponse, type PrunaProgressStage, PrunaProvider, type PrunaRequest, PrunaResult, type RequestImage, SPEECH_INPUT_MAX, SPEECH_VOICES, type SpeechAdapter, type SpeechRequest, type SpeechResult, type SpeechVoice, StreamRequestOptions$1 as StreamRequestOptions, type StructuredJsonRequest, TIMEOUTS, TextGenerationService, TextToVideoInput, TimeoutError, type ToolDefinition, ValidationError, configureProvider, consumeAnthropicStream, consumeGroqStream, createAnthropicAdapter, createAssistantMessage, createFalProvider, createGeminiProvider, createGroqProvider, createMessage, createOpenAiAudioTranscriptionAdapter, createOpenAiCompatibleAdapter, createOpenAiEmbeddingsAdapter, createOpenAiImageAdapter, createOpenAiSpeechAdapter, createPrunaProvider, createSystemMessage, createUserMessage, defaultEffortForModel, extractContentFromSsePayload, extractTextFromMessages, formatMessagesForDisplay, generateImageThenVideo, generate as generatePruna, generateWithPruna, getProvider, mapAnthropicStopReason, pollForResult, promptToMessages, requestStructuredJson, resetProvider, submitPrediction, toGroqMessages, uploadImage };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { C as CostEstimateRequest, d as ITextProvider, a as IMediaProvider } from '../provider.factory-
|
|
2
|
-
export { A as AnyProvider, I as IAIProvider, b as IProviderBase, P as ProviderCapability, e as ProviderFactory, f as ProviderFactoryConfig, g as createProviderFactory, i as isMediaProvider, h as isTextProvider } from '../provider.factory-
|
|
3
|
-
import { P as ProviderHealth, b as TextTier, T as TextRequest, G as GenerationResult, a as StructuredTextRequest, S as StructuredGeneration, d as StreamCallbacks, F as FinishReason, C as ChatMessage, c as TokenUsage } from '../index-
|
|
4
|
-
import { A as AIError, c as TierModelMap } from '../index-
|
|
5
|
-
import { h as AnthropicProviderConfig, e as AnthropicEffort, x as AnthropicMessage, f as AnthropicMessagesRequest, i as AnthropicStopReason, g as AnthropicMessagesResponse, t as GroqProviderConfig, r as GroqMessage, q as GroqGenerationConfig, k as GroqChatRequest, l as GroqChatResponse, S as StreamRequestOptions$1, s as GroqMessageRole, u as GroqReasoningEffort } from '../create-ai-
|
|
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-
|
|
1
|
+
import { C as CostEstimateRequest, d as ITextProvider, a as IMediaProvider } from '../provider.factory-B9RNUTYj.js';
|
|
2
|
+
export { A as AnyProvider, I as IAIProvider, b as IProviderBase, P as ProviderCapability, e as ProviderFactory, f as ProviderFactoryConfig, g as createProviderFactory, i as isMediaProvider, h as isTextProvider } from '../provider.factory-B9RNUTYj.js';
|
|
3
|
+
import { P as ProviderHealth, b as TextTier, T as TextRequest, G as GenerationResult, a as StructuredTextRequest, S as StructuredGeneration, d as StreamCallbacks, F as FinishReason, C as ChatMessage, c as TokenUsage } from '../index-OhvYUTXf.js';
|
|
4
|
+
import { A as AIError, c as TierModelMap } from '../index-1e91KRYU.js';
|
|
5
|
+
import { h as AnthropicProviderConfig, e as AnthropicEffort, x as AnthropicMessage, f as AnthropicMessagesRequest, i as AnthropicStopReason, g as AnthropicMessagesResponse, t as GroqProviderConfig, r as GroqMessage, q as GroqGenerationConfig, k as GroqChatRequest, l as GroqChatResponse, S as StreamRequestOptions$1, s as GroqMessageRole, u as GroqReasoningEffort } from '../create-ai-D-oEWzf9.js';
|
|
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-D-oEWzf9.js';
|
|
7
7
|
import { b as CacheStats } from '../cache-manager-Df9LLYGA.js';
|
|
8
|
-
import { b as RetryManager, a as RequestQueue, R as RequestDeduplicator } from '../
|
|
9
|
-
import { b as IGroqHttpClient, T as TextGenerationService, a as GenerationStage, f as PrunaModelId, h as PrunaPredictionResponse, m as TextToVideoInput, G as GenerateOptions, j as PrunaResult, e as PrunaInput } from '../cancellation-error-
|
|
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, n as TextGenerationOptions, l as TextToImageInput } from '../cancellation-error-
|
|
11
|
-
import { d as ChatService } from '../chat.service-
|
|
8
|
+
import { b as RetryManager, a as RequestQueue, R as RequestDeduplicator, A as AssistantToolCall } from '../tool-call-accumulator-C7KhaXZA.js';
|
|
9
|
+
import { b as IGroqHttpClient, T as TextGenerationService, a as GenerationStage, f as PrunaModelId, h as PrunaPredictionResponse, m as TextToVideoInput, G as GenerateOptions, j as PrunaResult, e as PrunaInput } from '../cancellation-error-hYcE9AS9.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, n as TextGenerationOptions, l as TextToImageInput } from '../cancellation-error-hYcE9AS9.js';
|
|
11
|
+
import { d as ChatService } from '../chat.service-B4Isrckn.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
|
|
|
14
14
|
interface BaseProviderConfig {
|
|
@@ -507,4 +507,54 @@ type ImageQuality = (typeof IMAGE_QUALITIES)[number];
|
|
|
507
507
|
declare const IMAGE_B64_LIMIT = 12000000;
|
|
508
508
|
declare function createOpenAiImageAdapter(config: OpenAiCompatibleConfig): ImageAdapter;
|
|
509
509
|
|
|
510
|
-
|
|
510
|
+
type AdapterChatRole = 'system' | 'user' | 'assistant' | 'tool';
|
|
511
|
+
interface AdapterChatMessage {
|
|
512
|
+
readonly role: AdapterChatRole;
|
|
513
|
+
readonly content: string;
|
|
514
|
+
readonly toolCalls?: readonly AssistantToolCall[];
|
|
515
|
+
readonly toolCallId?: string;
|
|
516
|
+
}
|
|
517
|
+
interface RequestImage {
|
|
518
|
+
readonly mimeType: string;
|
|
519
|
+
readonly dataBase64: string;
|
|
520
|
+
}
|
|
521
|
+
interface ToolDefinition {
|
|
522
|
+
readonly name: string;
|
|
523
|
+
readonly description: string;
|
|
524
|
+
readonly parameters: Record<string, unknown>;
|
|
525
|
+
}
|
|
526
|
+
interface AdapterRequest {
|
|
527
|
+
readonly externalModelId: string;
|
|
528
|
+
readonly messages: readonly AdapterChatMessage[];
|
|
529
|
+
readonly temperature: number;
|
|
530
|
+
readonly maxOutputTokens: number;
|
|
531
|
+
readonly topP: number;
|
|
532
|
+
readonly tools?: readonly ToolDefinition[];
|
|
533
|
+
readonly images?: readonly RequestImage[];
|
|
534
|
+
readonly signal?: AbortSignal;
|
|
535
|
+
}
|
|
536
|
+
type ProviderEvent = {
|
|
537
|
+
readonly type: 'delta';
|
|
538
|
+
readonly channel: 'answer' | 'reasoning';
|
|
539
|
+
readonly text: string;
|
|
540
|
+
} | {
|
|
541
|
+
readonly type: 'usage';
|
|
542
|
+
readonly usage: TokenUsage;
|
|
543
|
+
} | {
|
|
544
|
+
readonly type: 'tool_calls';
|
|
545
|
+
readonly calls: readonly AssistantToolCall[];
|
|
546
|
+
};
|
|
547
|
+
interface ChatAdapter {
|
|
548
|
+
stream(req: AdapterRequest): AsyncIterable<ProviderEvent>;
|
|
549
|
+
}
|
|
550
|
+
interface AdapterConfig {
|
|
551
|
+
readonly baseUrl: string;
|
|
552
|
+
readonly apiKey: string;
|
|
553
|
+
readonly timeoutMs: number;
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
declare function createOpenAiCompatibleAdapter(config: AdapterConfig): ChatAdapter;
|
|
557
|
+
|
|
558
|
+
declare function createAnthropicAdapter(config: AdapterConfig): ChatAdapter;
|
|
559
|
+
|
|
560
|
+
export { API_ENDPOINTS, type AdapterChatMessage, type AdapterChatRole, type AdapterConfig, type AdapterRequest, AnthropicEffort, AnthropicHttpTransport, AnthropicMessagesRequest, AnthropicMessagesResponse, AnthropicProvider, AnthropicProviderConfig, AnthropicRequestBuilder, AnthropicStopReason, type AppContainer, type AudioTranscriptionAdapter, type AudioTranscriptionRequest, type AudioTranscriptionResult, AuthenticationError, BaseProvider as BaseAIProvider, BaseProvider, type BaseProviderConfig, type ChatAdapter, CostEstimateRequest, DEFAULT_BASE_URL, DEFAULT_GENERATION_CONFIG, DEFAULT_MODELS, type EmbeddingsAdapter, type EmbeddingsRequest, type EmbeddingsResult, 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, IMAGE_B64_LIMIT, IMAGE_QUALITIES, IMAGE_SIZES, IMediaProvider, ITextProvider, type ImageAdapter, type ImageQuality, type ImageRequest, type ImageResult, type ImageSize, type OpenAiCompatibleConfig, ProviderError, type ProviderEvent, PrunaInput, PrunaModelId, PrunaPredictionResponse, type PrunaProgressStage, PrunaProvider, type PrunaRequest, PrunaResult, type RequestImage, SPEECH_INPUT_MAX, SPEECH_VOICES, type SpeechAdapter, type SpeechRequest, type SpeechResult, type SpeechVoice, StreamRequestOptions$1 as StreamRequestOptions, type StructuredJsonRequest, TIMEOUTS, TextGenerationService, TextToVideoInput, TimeoutError, type ToolDefinition, ValidationError, configureProvider, consumeAnthropicStream, consumeGroqStream, createAnthropicAdapter, createAssistantMessage, createFalProvider, createGeminiProvider, createGroqProvider, createMessage, createOpenAiAudioTranscriptionAdapter, createOpenAiCompatibleAdapter, createOpenAiEmbeddingsAdapter, createOpenAiImageAdapter, createOpenAiSpeechAdapter, createPrunaProvider, createSystemMessage, createUserMessage, defaultEffortForModel, extractContentFromSsePayload, extractTextFromMessages, formatMessagesForDisplay, generateImageThenVideo, generate as generatePruna, generateWithPruna, getProvider, mapAnthropicStopReason, pollForResult, promptToMessages, requestStructuredJson, resetProvider, submitPrediction, toGroqMessages, uploadImage };
|
package/dist/providers/index.js
CHANGED
|
@@ -244,6 +244,68 @@ async function extractErrorMessageFromResponse(response) {
|
|
|
244
244
|
return buildHttpStatusFallback(response.status, response.statusText);
|
|
245
245
|
}
|
|
246
246
|
|
|
247
|
+
// src/core/errors/unified-ai-error.ts
|
|
248
|
+
var STATUS_TO_CODE = {
|
|
249
|
+
400: "invalid_request",
|
|
250
|
+
401: "invalid_key",
|
|
251
|
+
403: "invalid_key",
|
|
252
|
+
404: "model_unavailable",
|
|
253
|
+
413: "invalid_request",
|
|
254
|
+
422: "invalid_request",
|
|
255
|
+
429: "rate_limited",
|
|
256
|
+
500: "upstream_error",
|
|
257
|
+
502: "upstream_error",
|
|
258
|
+
503: "capacity",
|
|
259
|
+
504: "timeout"
|
|
260
|
+
};
|
|
261
|
+
var CODE_MESSAGES = {
|
|
262
|
+
invalid_key: "The provider rejected the configured API key.",
|
|
263
|
+
missing_key: "The provider is not configured with an API key.",
|
|
264
|
+
rate_limited: "The provider rate limit was reached. Try again shortly.",
|
|
265
|
+
capacity: "The provider is temporarily at capacity. Try again shortly.",
|
|
266
|
+
timeout: "The model took too long to respond.",
|
|
267
|
+
invalid_request: "The request was rejected by the provider.",
|
|
268
|
+
model_unavailable: "The requested model is not available.",
|
|
269
|
+
upstream_error: "The provider returned an unexpected error.",
|
|
270
|
+
network: "Could not reach the provider.",
|
|
271
|
+
cancelled: "Generation was cancelled."
|
|
272
|
+
};
|
|
273
|
+
var AiError = class extends Error {
|
|
274
|
+
code;
|
|
275
|
+
constructor(code, message) {
|
|
276
|
+
super(message ?? CODE_MESSAGES[code]);
|
|
277
|
+
this.name = "AiError";
|
|
278
|
+
this.code = code;
|
|
279
|
+
}
|
|
280
|
+
get userMessage() {
|
|
281
|
+
return this.message;
|
|
282
|
+
}
|
|
283
|
+
};
|
|
284
|
+
function isApiKeyRejection(provider) {
|
|
285
|
+
if (provider.code === "invalid_api_key") return true;
|
|
286
|
+
return provider.type === void 0;
|
|
287
|
+
}
|
|
288
|
+
function errorFromStatus(status, detail, provider) {
|
|
289
|
+
let code = STATUS_TO_CODE[status] ?? "upstream_error";
|
|
290
|
+
if (status === 403 && provider && !isApiKeyRejection(provider)) {
|
|
291
|
+
code = "model_unavailable";
|
|
292
|
+
}
|
|
293
|
+
return new AiError(code, detail ? `${CODE_MESSAGES[code]} (${detail})` : void 0);
|
|
294
|
+
}
|
|
295
|
+
function errorFromUnknown(err) {
|
|
296
|
+
if (err instanceof AiError) return err;
|
|
297
|
+
if (err instanceof Error) {
|
|
298
|
+
if (err.name === "TimeoutError" || err.name === "AbortError") {
|
|
299
|
+
return new AiError("timeout");
|
|
300
|
+
}
|
|
301
|
+
if (err.name === "TypeError") {
|
|
302
|
+
return new AiError("network");
|
|
303
|
+
}
|
|
304
|
+
return new AiError("upstream_error", err.message);
|
|
305
|
+
}
|
|
306
|
+
return new AiError("upstream_error");
|
|
307
|
+
}
|
|
308
|
+
|
|
247
309
|
// src/providers/factory/provider.factory.ts
|
|
248
310
|
var ProviderFactory = class {
|
|
249
311
|
providers = /* @__PURE__ */ new Map();
|
|
@@ -4161,6 +4223,323 @@ function createOpenAiImageAdapter(config) {
|
|
|
4161
4223
|
};
|
|
4162
4224
|
}
|
|
4163
4225
|
|
|
4164
|
-
|
|
4226
|
+
// src/core/sse/tool-call-accumulator.ts
|
|
4227
|
+
var ToolCallAccumulator = class {
|
|
4228
|
+
slots = /* @__PURE__ */ new Map();
|
|
4229
|
+
push(delta) {
|
|
4230
|
+
const index = delta.index ?? 0;
|
|
4231
|
+
const slot = this.slots.get(index) ?? { id: "", name: "", args: "" };
|
|
4232
|
+
if (delta.id) slot.id = delta.id;
|
|
4233
|
+
if (delta.function?.name) slot.name = delta.function.name;
|
|
4234
|
+
if (delta.function?.arguments) slot.args += delta.function.arguments;
|
|
4235
|
+
this.slots.set(index, slot);
|
|
4236
|
+
}
|
|
4237
|
+
finish() {
|
|
4238
|
+
return Array.from(this.slots.entries()).sort(([a], [b]) => a - b).map(([, slot]) => ({
|
|
4239
|
+
id: slot.id,
|
|
4240
|
+
name: slot.name,
|
|
4241
|
+
arguments: slot.args
|
|
4242
|
+
})).filter((call) => call.id.length > 0 || call.name.length > 0);
|
|
4243
|
+
}
|
|
4244
|
+
};
|
|
4245
|
+
|
|
4246
|
+
// src/providers/adapters/openai-compatible.adapter.ts
|
|
4247
|
+
function toWireMessage(message) {
|
|
4248
|
+
if (message.role === "tool") {
|
|
4249
|
+
return { role: "tool", content: message.content, tool_call_id: message.toolCallId ?? "" };
|
|
4250
|
+
}
|
|
4251
|
+
if (message.role === "assistant" && message.toolCalls && message.toolCalls.length > 0) {
|
|
4252
|
+
return {
|
|
4253
|
+
role: "assistant",
|
|
4254
|
+
content: message.content,
|
|
4255
|
+
tool_calls: message.toolCalls.map((call) => ({
|
|
4256
|
+
id: call.id,
|
|
4257
|
+
type: "function",
|
|
4258
|
+
function: { name: call.name, arguments: call.arguments }
|
|
4259
|
+
}))
|
|
4260
|
+
};
|
|
4261
|
+
}
|
|
4262
|
+
if (message.role === "user") return { role: "user", content: message.content };
|
|
4263
|
+
return { role: message.role, content: message.content };
|
|
4264
|
+
}
|
|
4265
|
+
function mergeImages(messages, images) {
|
|
4266
|
+
if (images.length === 0) return [...messages];
|
|
4267
|
+
const parts = images.map((image) => ({
|
|
4268
|
+
type: "image_url",
|
|
4269
|
+
image_url: { url: `data:${image.mimeType};base64,${image.dataBase64}` }
|
|
4270
|
+
}));
|
|
4271
|
+
for (let index = messages.length - 1; index >= 0; index -= 1) {
|
|
4272
|
+
const message = messages[index];
|
|
4273
|
+
if (message.role !== "user") continue;
|
|
4274
|
+
const textParts = typeof message.content === "string" ? message.content.length > 0 ? [{ type: "text", text: message.content }] : [] : message.content;
|
|
4275
|
+
return [
|
|
4276
|
+
...messages.slice(0, index),
|
|
4277
|
+
{ role: "user", content: [...textParts, ...parts] },
|
|
4278
|
+
...messages.slice(index + 1)
|
|
4279
|
+
];
|
|
4280
|
+
}
|
|
4281
|
+
return [...messages, { role: "user", content: [...parts] }];
|
|
4282
|
+
}
|
|
4283
|
+
async function extractErrorDetail(response) {
|
|
4284
|
+
try {
|
|
4285
|
+
const body = await response.json();
|
|
4286
|
+
return body.error;
|
|
4287
|
+
} catch {
|
|
4288
|
+
return void 0;
|
|
4289
|
+
}
|
|
4290
|
+
}
|
|
4291
|
+
async function* parseSseEvent(rawEvent, toolCallAccumulator) {
|
|
4292
|
+
for (const line of rawEvent.split("\n")) {
|
|
4293
|
+
if (!line.startsWith("data:")) continue;
|
|
4294
|
+
const payload = line.slice(5).trim();
|
|
4295
|
+
if (payload.length === 0 || payload === "[DONE]") continue;
|
|
4296
|
+
let chunk;
|
|
4297
|
+
try {
|
|
4298
|
+
chunk = JSON.parse(payload);
|
|
4299
|
+
} catch {
|
|
4300
|
+
continue;
|
|
4301
|
+
}
|
|
4302
|
+
const delta = chunk.choices?.[0]?.delta;
|
|
4303
|
+
if (delta?.reasoning) {
|
|
4304
|
+
yield { type: "delta", channel: "reasoning", text: delta.reasoning };
|
|
4305
|
+
}
|
|
4306
|
+
if (delta?.content) {
|
|
4307
|
+
yield { type: "delta", channel: "answer", text: delta.content };
|
|
4308
|
+
}
|
|
4309
|
+
if (delta?.tool_calls) {
|
|
4310
|
+
for (const toolCallDelta of delta.tool_calls) toolCallAccumulator.push(toolCallDelta);
|
|
4311
|
+
}
|
|
4312
|
+
if (chunk.usage) {
|
|
4313
|
+
yield {
|
|
4314
|
+
type: "usage",
|
|
4315
|
+
usage: {
|
|
4316
|
+
inputTokens: chunk.usage.prompt_tokens ?? 0,
|
|
4317
|
+
outputTokens: chunk.usage.completion_tokens ?? 0,
|
|
4318
|
+
reasoningTokens: chunk.usage.completion_tokens_details?.reasoning_tokens
|
|
4319
|
+
}
|
|
4320
|
+
};
|
|
4321
|
+
}
|
|
4322
|
+
}
|
|
4323
|
+
}
|
|
4324
|
+
async function* parseSseStream(body) {
|
|
4325
|
+
const reader = body.getReader();
|
|
4326
|
+
const decoder = new TextDecoder();
|
|
4327
|
+
const toolCallAccumulator = new ToolCallAccumulator();
|
|
4328
|
+
let buffer = "";
|
|
4329
|
+
try {
|
|
4330
|
+
while (true) {
|
|
4331
|
+
const { done, value } = await reader.read();
|
|
4332
|
+
if (done) break;
|
|
4333
|
+
buffer += decoder.decode(value, { stream: true });
|
|
4334
|
+
let separator = buffer.indexOf("\n\n");
|
|
4335
|
+
while (separator !== -1) {
|
|
4336
|
+
const rawEvent = buffer.slice(0, separator);
|
|
4337
|
+
buffer = buffer.slice(separator + 2);
|
|
4338
|
+
separator = buffer.indexOf("\n\n");
|
|
4339
|
+
yield* parseSseEvent(rawEvent, toolCallAccumulator);
|
|
4340
|
+
}
|
|
4341
|
+
}
|
|
4342
|
+
} catch (err) {
|
|
4343
|
+
throw errorFromUnknown(err);
|
|
4344
|
+
} finally {
|
|
4345
|
+
reader.releaseLock();
|
|
4346
|
+
}
|
|
4347
|
+
const calls = toolCallAccumulator.finish();
|
|
4348
|
+
if (calls.length > 0) yield { type: "tool_calls", calls };
|
|
4349
|
+
}
|
|
4350
|
+
function createOpenAiCompatibleAdapter(config) {
|
|
4351
|
+
return {
|
|
4352
|
+
async *stream(req) {
|
|
4353
|
+
const timeout = AbortSignal.timeout(config.timeoutMs);
|
|
4354
|
+
const signal = req.signal ? AbortSignal.any([req.signal, timeout]) : timeout;
|
|
4355
|
+
let response;
|
|
4356
|
+
try {
|
|
4357
|
+
response = await fetch(`${config.baseUrl}/chat/completions`, {
|
|
4358
|
+
method: "POST",
|
|
4359
|
+
headers: {
|
|
4360
|
+
Authorization: `Bearer ${config.apiKey}`,
|
|
4361
|
+
"Content-Type": "application/json"
|
|
4362
|
+
},
|
|
4363
|
+
body: JSON.stringify({
|
|
4364
|
+
model: req.externalModelId,
|
|
4365
|
+
messages: mergeImages(req.messages.map(toWireMessage), req.images ?? []),
|
|
4366
|
+
temperature: req.temperature,
|
|
4367
|
+
max_completion_tokens: req.maxOutputTokens,
|
|
4368
|
+
top_p: req.topP,
|
|
4369
|
+
stream: true,
|
|
4370
|
+
stream_options: { include_usage: true },
|
|
4371
|
+
...req.tools && req.tools.length > 0 ? {
|
|
4372
|
+
tools: req.tools.map((tool) => ({ type: "function", function: tool })),
|
|
4373
|
+
tool_choice: "auto"
|
|
4374
|
+
} : {}
|
|
4375
|
+
}),
|
|
4376
|
+
signal
|
|
4377
|
+
});
|
|
4378
|
+
} catch (err) {
|
|
4379
|
+
throw errorFromUnknown(err);
|
|
4380
|
+
}
|
|
4381
|
+
if (!response.ok || !response.body) {
|
|
4382
|
+
const detail = await extractErrorDetail(response);
|
|
4383
|
+
throw errorFromStatus(response.status, detail?.message, detail);
|
|
4384
|
+
}
|
|
4385
|
+
yield* parseSseStream(response.body);
|
|
4386
|
+
}
|
|
4387
|
+
};
|
|
4388
|
+
}
|
|
4389
|
+
|
|
4390
|
+
// src/providers/adapters/anthropic.adapter.ts
|
|
4391
|
+
var ANTHROPIC_VERSION = "2023-06-01";
|
|
4392
|
+
var ERROR_TYPE_TO_CODE = {
|
|
4393
|
+
invalid_request_error: "invalid_request",
|
|
4394
|
+
authentication_error: "invalid_key",
|
|
4395
|
+
permission_error: "invalid_key",
|
|
4396
|
+
not_found_error: "model_unavailable",
|
|
4397
|
+
request_too_large: "invalid_request",
|
|
4398
|
+
rate_limit_error: "rate_limited",
|
|
4399
|
+
overloaded_error: "capacity",
|
|
4400
|
+
api_error: "upstream_error"
|
|
4401
|
+
};
|
|
4402
|
+
function mergeImages2(messages, images) {
|
|
4403
|
+
if (images.length === 0) return [...messages];
|
|
4404
|
+
const blocks = images.map((image) => ({
|
|
4405
|
+
type: "image",
|
|
4406
|
+
source: { type: "base64", media_type: image.mimeType, data: image.dataBase64 }
|
|
4407
|
+
}));
|
|
4408
|
+
for (let index = messages.length - 1; index >= 0; index -= 1) {
|
|
4409
|
+
const message = messages[index];
|
|
4410
|
+
if (message.role !== "user") continue;
|
|
4411
|
+
const textBlocks = typeof message.content === "string" ? message.content.length > 0 ? [{ type: "text", text: message.content }] : [] : message.content;
|
|
4412
|
+
return [
|
|
4413
|
+
...messages.slice(0, index),
|
|
4414
|
+
{ role: "user", content: [...textBlocks, ...blocks] },
|
|
4415
|
+
...messages.slice(index + 1)
|
|
4416
|
+
];
|
|
4417
|
+
}
|
|
4418
|
+
return [...messages, { role: "user", content: [...blocks] }];
|
|
4419
|
+
}
|
|
4420
|
+
async function extractErrorDetail2(response) {
|
|
4421
|
+
try {
|
|
4422
|
+
const body = await response.json();
|
|
4423
|
+
return body.error?.message;
|
|
4424
|
+
} catch {
|
|
4425
|
+
return void 0;
|
|
4426
|
+
}
|
|
4427
|
+
}
|
|
4428
|
+
function wireError(error) {
|
|
4429
|
+
const code = error.type && ERROR_TYPE_TO_CODE[error.type] || "upstream_error";
|
|
4430
|
+
return new AiError(code, error.message);
|
|
4431
|
+
}
|
|
4432
|
+
function* parseAnthropicEvent(rawEvent) {
|
|
4433
|
+
for (const line of rawEvent.split("\n")) {
|
|
4434
|
+
if (!line.startsWith("data:")) continue;
|
|
4435
|
+
const payload = line.slice(5).trim();
|
|
4436
|
+
if (payload.length === 0) continue;
|
|
4437
|
+
try {
|
|
4438
|
+
yield JSON.parse(payload);
|
|
4439
|
+
} catch {
|
|
4440
|
+
continue;
|
|
4441
|
+
}
|
|
4442
|
+
}
|
|
4443
|
+
}
|
|
4444
|
+
function mergeOutputTokens(previous, outputTokens) {
|
|
4445
|
+
return {
|
|
4446
|
+
inputTokens: previous?.inputTokens ?? 0,
|
|
4447
|
+
outputTokens,
|
|
4448
|
+
reasoningTokens: previous?.reasoningTokens
|
|
4449
|
+
};
|
|
4450
|
+
}
|
|
4451
|
+
async function* parseAnthropicStream(body) {
|
|
4452
|
+
const reader = body.getReader();
|
|
4453
|
+
const decoder = new TextDecoder();
|
|
4454
|
+
let buffer = "";
|
|
4455
|
+
let usage = null;
|
|
4456
|
+
let usageEmitted = false;
|
|
4457
|
+
const flushUsage = function* () {
|
|
4458
|
+
if (usage && !usageEmitted && (usage.inputTokens > 0 || usage.outputTokens > 0)) {
|
|
4459
|
+
usageEmitted = true;
|
|
4460
|
+
yield { type: "usage", usage };
|
|
4461
|
+
}
|
|
4462
|
+
};
|
|
4463
|
+
try {
|
|
4464
|
+
while (true) {
|
|
4465
|
+
const { done, value } = await reader.read();
|
|
4466
|
+
if (done) break;
|
|
4467
|
+
buffer += decoder.decode(value, { stream: true });
|
|
4468
|
+
let separator = buffer.indexOf("\n\n");
|
|
4469
|
+
while (separator !== -1) {
|
|
4470
|
+
const rawEvent = buffer.slice(0, separator);
|
|
4471
|
+
buffer = buffer.slice(separator + 2);
|
|
4472
|
+
separator = buffer.indexOf("\n\n");
|
|
4473
|
+
for (const event of parseAnthropicEvent(rawEvent)) {
|
|
4474
|
+
if (event.error) throw wireError(event.error);
|
|
4475
|
+
if (event.type === "message_start" && event.message?.usage) {
|
|
4476
|
+
usage = {
|
|
4477
|
+
inputTokens: event.message.usage.input_tokens ?? 0,
|
|
4478
|
+
outputTokens: 0,
|
|
4479
|
+
reasoningTokens: void 0
|
|
4480
|
+
};
|
|
4481
|
+
} else if (event.type === "message_delta" && event.usage) {
|
|
4482
|
+
usage = mergeOutputTokens(usage, event.usage.output_tokens ?? 0);
|
|
4483
|
+
} else if (event.type === "message_stop") {
|
|
4484
|
+
yield* flushUsage();
|
|
4485
|
+
} else if (event.delta?.type === "text_delta" && event.delta.text) {
|
|
4486
|
+
yield { type: "delta", channel: "answer", text: event.delta.text };
|
|
4487
|
+
} else if (event.delta?.type === "thinking_delta" && event.delta.thinking) {
|
|
4488
|
+
yield { type: "delta", channel: "reasoning", text: event.delta.thinking };
|
|
4489
|
+
}
|
|
4490
|
+
}
|
|
4491
|
+
}
|
|
4492
|
+
}
|
|
4493
|
+
yield* flushUsage();
|
|
4494
|
+
} catch (err) {
|
|
4495
|
+
throw err instanceof AiError ? err : errorFromUnknown(err);
|
|
4496
|
+
} finally {
|
|
4497
|
+
reader.releaseLock();
|
|
4498
|
+
}
|
|
4499
|
+
}
|
|
4500
|
+
function createAnthropicAdapter(config) {
|
|
4501
|
+
return {
|
|
4502
|
+
async *stream(req) {
|
|
4503
|
+
const timeout = AbortSignal.timeout(config.timeoutMs);
|
|
4504
|
+
const signal = req.signal ? AbortSignal.any([req.signal, timeout]) : timeout;
|
|
4505
|
+
const system = req.messages.filter((message) => message.role === "system").map((message) => message.content).join("\n\n");
|
|
4506
|
+
const messages = mergeImages2(
|
|
4507
|
+
req.messages.filter((message) => message.role !== "system").map((message) => {
|
|
4508
|
+
if (message.role === "user") return { role: "user", content: message.content };
|
|
4509
|
+
return { role: "assistant", content: message.content };
|
|
4510
|
+
}),
|
|
4511
|
+
req.images ?? []
|
|
4512
|
+
);
|
|
4513
|
+
let response;
|
|
4514
|
+
try {
|
|
4515
|
+
response = await fetch(`${config.baseUrl}/v1/messages`, {
|
|
4516
|
+
method: "POST",
|
|
4517
|
+
headers: {
|
|
4518
|
+
"x-api-key": config.apiKey,
|
|
4519
|
+
"anthropic-version": ANTHROPIC_VERSION,
|
|
4520
|
+
"Content-Type": "application/json"
|
|
4521
|
+
},
|
|
4522
|
+
body: JSON.stringify({
|
|
4523
|
+
model: req.externalModelId,
|
|
4524
|
+
messages,
|
|
4525
|
+
...system.length > 0 ? { system } : {},
|
|
4526
|
+
max_tokens: req.maxOutputTokens,
|
|
4527
|
+
stream: true
|
|
4528
|
+
}),
|
|
4529
|
+
signal
|
|
4530
|
+
});
|
|
4531
|
+
} catch (err) {
|
|
4532
|
+
throw errorFromUnknown(err);
|
|
4533
|
+
}
|
|
4534
|
+
if (!response.ok || !response.body) {
|
|
4535
|
+
const detail = await extractErrorDetail2(response);
|
|
4536
|
+
throw errorFromStatus(response.status, detail);
|
|
4537
|
+
}
|
|
4538
|
+
yield* parseAnthropicStream(response.body);
|
|
4539
|
+
}
|
|
4540
|
+
};
|
|
4541
|
+
}
|
|
4542
|
+
|
|
4543
|
+
export { ANTHROPIC_API_VERSION, ANTHROPIC_DEFAULT_MAX_TOKENS, ANTHROPIC_MODELS, ANTHROPIC_TIERS, API_ENDPOINTS, AnthropicHttpTransport, AnthropicProvider, AnthropicRequestBuilder, AuthenticationError, BaseProvider as BaseAIProvider, BaseProvider, CancellationError, DEFAULT_BASE_URL, DEFAULT_GENERATION_CONFIG, DEFAULT_MODELS, FalProvider, GEMINI_TIERS, GROQ_MODELS, GROQ_TIERS, GeminiProvider, GenerationFailedError, GroqChatRequestBuilder, GroqConfigStore, GroqHttpClient, GroqHttpTransport, GroqProvider, IMAGE_B64_LIMIT, IMAGE_QUALITIES, IMAGE_SIZES, ProviderError, ProviderFactory, PrunaProvider, SPEECH_INPUT_MAX, SPEECH_VOICES, TIMEOUTS, TextGenerationService, TimeoutError, ValidationError, configureProvider, consumeAnthropicStream, consumeGroqStream, createAI, createAnthropicAdapter, createAssistantMessage, createFalProvider, createGeminiProvider, createGroqProvider, createMessage, createOpenAiAudioTranscriptionAdapter, createOpenAiCompatibleAdapter, createOpenAiEmbeddingsAdapter, createOpenAiImageAdapter, createOpenAiSpeechAdapter, createProviderFactory, createPrunaProvider, createSystemMessage, createUserMessage, defaultEffortForModel, extractContentFromSsePayload, extractTextFromMessages, formatMessagesForDisplay, generateImageThenVideo, generate as generatePruna, generateWithPruna, getProvider, isMediaProvider, isTextProvider, mapAnthropicStopReason, pollForResult, promptToMessages, requestStructuredJson, resetProvider, submitPrediction, toGroqMessages, uploadImage };
|
|
4165
4544
|
//# sourceMappingURL=index.js.map
|
|
4166
4545
|
//# sourceMappingURL=index.js.map
|