@reactive-agents/llm-provider 0.2.0 → 0.4.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/index.d.ts +34 -2
- package/dist/index.js +1341 -186
- package/dist/index.js.map +1 -1
- package/package.json +6 -4
package/dist/index.d.ts
CHANGED
|
@@ -161,6 +161,10 @@ type LLMMessage = {
|
|
|
161
161
|
} | {
|
|
162
162
|
readonly role: "assistant";
|
|
163
163
|
readonly content: string | readonly ContentBlock[];
|
|
164
|
+
} | {
|
|
165
|
+
readonly role: "tool";
|
|
166
|
+
readonly toolCallId: string;
|
|
167
|
+
readonly content: string;
|
|
164
168
|
};
|
|
165
169
|
declare const TokenUsageSchema: Schema.Struct<{
|
|
166
170
|
inputTokens: typeof Schema.Number;
|
|
@@ -372,6 +376,34 @@ declare const LLMConfig_base: Context.TagClass<LLMConfig, "LLMConfig", {
|
|
|
372
376
|
*/
|
|
373
377
|
declare class LLMConfig extends LLMConfig_base {
|
|
374
378
|
}
|
|
379
|
+
/**
|
|
380
|
+
* Raw LLMConfig value from environment variables.
|
|
381
|
+
* Exported so callers can spread overrides (e.g. model) on top.
|
|
382
|
+
*/
|
|
383
|
+
declare const llmConfigFromEnv: {
|
|
384
|
+
readonly defaultProvider: LLMProvider;
|
|
385
|
+
readonly defaultModel: string;
|
|
386
|
+
readonly anthropicApiKey?: string;
|
|
387
|
+
readonly openaiApiKey?: string;
|
|
388
|
+
readonly googleApiKey?: string;
|
|
389
|
+
readonly ollamaEndpoint?: string;
|
|
390
|
+
/**
|
|
391
|
+
* Embedding configuration. Anthropic has no embeddings API;
|
|
392
|
+
* embeddings route to OpenAI (default) or Ollama.
|
|
393
|
+
* This is the SOLE embedding config for the entire framework.
|
|
394
|
+
*/
|
|
395
|
+
readonly embeddingConfig: EmbeddingConfig;
|
|
396
|
+
/**
|
|
397
|
+
* Enable Anthropic prompt caching.
|
|
398
|
+
* When true, memory context injections are wrapped in
|
|
399
|
+
* `cache_control: { type: "ephemeral" }` blocks.
|
|
400
|
+
*/
|
|
401
|
+
readonly supportsPromptCaching: boolean;
|
|
402
|
+
readonly maxRetries: number;
|
|
403
|
+
readonly timeoutMs: number;
|
|
404
|
+
readonly defaultMaxTokens: number;
|
|
405
|
+
readonly defaultTemperature: number;
|
|
406
|
+
};
|
|
375
407
|
/**
|
|
376
408
|
* Build LLMConfig from environment variables.
|
|
377
409
|
*/
|
|
@@ -533,10 +565,10 @@ type ComplexityAnalysis = Schema.Schema.Type<typeof ComplexityAnalysisSchema>;
|
|
|
533
565
|
* Create the LLM provider layer for a specific provider.
|
|
534
566
|
* Uses env vars for configuration by default.
|
|
535
567
|
*/
|
|
536
|
-
declare const createLLMProviderLayer: (provider?: "anthropic" | "openai" | "ollama" | "gemini" | "test", testResponses?: Record<string, string
|
|
568
|
+
declare const createLLMProviderLayer: (provider?: "anthropic" | "openai" | "ollama" | "gemini" | "test", testResponses?: Record<string, string>, model?: string) => Layer.Layer<LLMService | PromptManager, never, never>;
|
|
537
569
|
/**
|
|
538
570
|
* LLM layer with custom config (for programmatic use).
|
|
539
571
|
*/
|
|
540
572
|
declare const createLLMProviderLayerWithConfig: (config: typeof LLMConfig.Service, provider?: "anthropic" | "openai" | "ollama" | "gemini") => Layer.Layer<LLMService | PromptManager, never, never>;
|
|
541
573
|
|
|
542
|
-
export { AnthropicProviderLive, type CacheControl, CacheControlSchema, type CacheableContentBlock, type CompletionRequest, type CompletionResponse, CompletionResponseSchema, type ComplexityAnalysis, ComplexityAnalysisSchema, type ContentBlock, DefaultEmbeddingConfig, type EmbeddingConfig, EmbeddingConfigSchema, GeminiProviderLive, ImageContentBlockSchema, type ImageSource, ImageSourceSchema, LLMConfig, LLMConfigFromEnv, LLMContextOverflowError, LLMError, type LLMErrors, type LLMMessage, LLMParseError, type LLMProvider, LLMProviderType, LLMRateLimitError, LLMService, LLMTimeoutError, LocalProviderLive, type ModelConfig, ModelConfigSchema, type ModelPresetName, ModelPresets, OpenAIProviderLive, type Plan, PlanSchema, PromptManager, PromptManagerLive, type ReActAction, ReActActionSchema, type Reflection, ReflectionSchema, type StopReason, StopReasonSchema, type StrategySelection, StrategySelectionSchema, type StreamEvent, type StructuredCompletionRequest, TestLLMService, TestLLMServiceLayer, TextContentBlockSchema, type ThoughtEvaluation, ThoughtEvaluationSchema, type TokenUsage, TokenUsageSchema, type ToolCall, ToolCallSchema, type ToolDefinition, ToolDefinitionSchema, ToolResultContentBlockSchema, ToolUseContentBlockSchema, type TruncationStrategy, calculateCost, createLLMProviderLayer, createLLMProviderLayerWithConfig, estimateTokenCount, makeCacheable, retryPolicy };
|
|
574
|
+
export { AnthropicProviderLive, type CacheControl, CacheControlSchema, type CacheableContentBlock, type CompletionRequest, type CompletionResponse, CompletionResponseSchema, type ComplexityAnalysis, ComplexityAnalysisSchema, type ContentBlock, DefaultEmbeddingConfig, type EmbeddingConfig, EmbeddingConfigSchema, GeminiProviderLive, ImageContentBlockSchema, type ImageSource, ImageSourceSchema, LLMConfig, LLMConfigFromEnv, LLMContextOverflowError, LLMError, type LLMErrors, type LLMMessage, LLMParseError, type LLMProvider, LLMProviderType, LLMRateLimitError, LLMService, LLMTimeoutError, LocalProviderLive, type ModelConfig, ModelConfigSchema, type ModelPresetName, ModelPresets, OpenAIProviderLive, type Plan, PlanSchema, PromptManager, PromptManagerLive, type ReActAction, ReActActionSchema, type Reflection, ReflectionSchema, type StopReason, StopReasonSchema, type StrategySelection, StrategySelectionSchema, type StreamEvent, type StructuredCompletionRequest, TestLLMService, TestLLMServiceLayer, TextContentBlockSchema, type ThoughtEvaluation, ThoughtEvaluationSchema, type TokenUsage, TokenUsageSchema, type ToolCall, ToolCallSchema, type ToolDefinition, ToolDefinitionSchema, ToolResultContentBlockSchema, ToolUseContentBlockSchema, type TruncationStrategy, calculateCost, createLLMProviderLayer, createLLMProviderLayerWithConfig, estimateTokenCount, llmConfigFromEnv, makeCacheable, retryPolicy };
|