@probeo/anymodel 0.3.1 → 0.5.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/README.md +27 -3
- package/dist/cli.cjs +556 -18
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +556 -18
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +565 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +19 -1
- package/dist/index.d.ts +19 -1
- package/dist/index.js +562 -18
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -77,6 +77,7 @@ interface ChatCompletionRequest {
|
|
|
77
77
|
tools?: Tool[];
|
|
78
78
|
tool_choice?: ToolChoice;
|
|
79
79
|
user?: string;
|
|
80
|
+
service_tier?: 'auto' | 'flex';
|
|
80
81
|
models?: string[];
|
|
81
82
|
route?: 'fallback';
|
|
82
83
|
transforms?: string[];
|
|
@@ -629,4 +630,21 @@ declare function createOpenAIBatchAdapter(apiKey: string): BatchAdapter;
|
|
|
629
630
|
|
|
630
631
|
declare function createAnthropicBatchAdapter(apiKey: string): BatchAdapter;
|
|
631
632
|
|
|
632
|
-
|
|
633
|
+
declare function createGoogleBatchAdapter(apiKey: string): BatchAdapter;
|
|
634
|
+
|
|
635
|
+
/**
|
|
636
|
+
* Rough token estimation and model-limit lookups for automatic max_tokens calculation.
|
|
637
|
+
*/
|
|
638
|
+
/** Estimate the number of tokens in a string (~4 chars per token). */
|
|
639
|
+
declare function estimateTokenCount(text: string): number;
|
|
640
|
+
/**
|
|
641
|
+
* Determine the best max_tokens value for a request.
|
|
642
|
+
*
|
|
643
|
+
* - If the caller already supplied a value, return it unchanged.
|
|
644
|
+
* - Otherwise estimate input tokens, apply a 5 % safety margin, then
|
|
645
|
+
* return min(maxCompletionTokens, contextLength - estimatedInput).
|
|
646
|
+
* - The result is clamped to at least 1.
|
|
647
|
+
*/
|
|
648
|
+
declare function resolveMaxTokens(model: string, messages: unknown[], userMaxTokens?: number): number;
|
|
649
|
+
|
|
650
|
+
export { AnyModel, type AnyModelConfig, AnyModelError, type AnyModelErrorMetadata, type BatchAdapter, type BatchCreateRequest, BatchManager, type BatchMode, type BatchObject, type BatchPollOptions, type BatchRequestItem, type BatchResultItem, type BatchResults, type BatchStatus, BatchStore, type BatchUsageSummary, type ChatCompletion, type ChatCompletionChoice, type ChatCompletionChunk, type ChatCompletionRequest, type ChunkChoice, type ChunkDelta, type ContentPart, type CustomProviderConfig, type FinishReason, type GenerationStats, GenerationStatsStore, type Message, type ModelArchitecture, type ModelInfo, type ModelPricing, type ModelTopProvider, type NativeBatchStatus, type ProviderAdapter, type ProviderConfig, type ProviderPreferences, type ResponseFormat, type Role, type ServerOptions, type Tool, type ToolCall, type ToolChoice, type Usage, appendFileQueued, configureFsIO, createAnthropicBatchAdapter, createAnyModelServer, createGoogleBatchAdapter, createOpenAIBatchAdapter, ensureDir, estimateTokenCount, getFsQueueStatus, joinPath, readFileQueued, resolveConfig, resolveMaxTokens, startServer, waitForFsQueuesIdle, writeFileFlushedQueued, writeFileQueued };
|
package/dist/index.d.ts
CHANGED
|
@@ -77,6 +77,7 @@ interface ChatCompletionRequest {
|
|
|
77
77
|
tools?: Tool[];
|
|
78
78
|
tool_choice?: ToolChoice;
|
|
79
79
|
user?: string;
|
|
80
|
+
service_tier?: 'auto' | 'flex';
|
|
80
81
|
models?: string[];
|
|
81
82
|
route?: 'fallback';
|
|
82
83
|
transforms?: string[];
|
|
@@ -629,4 +630,21 @@ declare function createOpenAIBatchAdapter(apiKey: string): BatchAdapter;
|
|
|
629
630
|
|
|
630
631
|
declare function createAnthropicBatchAdapter(apiKey: string): BatchAdapter;
|
|
631
632
|
|
|
632
|
-
|
|
633
|
+
declare function createGoogleBatchAdapter(apiKey: string): BatchAdapter;
|
|
634
|
+
|
|
635
|
+
/**
|
|
636
|
+
* Rough token estimation and model-limit lookups for automatic max_tokens calculation.
|
|
637
|
+
*/
|
|
638
|
+
/** Estimate the number of tokens in a string (~4 chars per token). */
|
|
639
|
+
declare function estimateTokenCount(text: string): number;
|
|
640
|
+
/**
|
|
641
|
+
* Determine the best max_tokens value for a request.
|
|
642
|
+
*
|
|
643
|
+
* - If the caller already supplied a value, return it unchanged.
|
|
644
|
+
* - Otherwise estimate input tokens, apply a 5 % safety margin, then
|
|
645
|
+
* return min(maxCompletionTokens, contextLength - estimatedInput).
|
|
646
|
+
* - The result is clamped to at least 1.
|
|
647
|
+
*/
|
|
648
|
+
declare function resolveMaxTokens(model: string, messages: unknown[], userMaxTokens?: number): number;
|
|
649
|
+
|
|
650
|
+
export { AnyModel, type AnyModelConfig, AnyModelError, type AnyModelErrorMetadata, type BatchAdapter, type BatchCreateRequest, BatchManager, type BatchMode, type BatchObject, type BatchPollOptions, type BatchRequestItem, type BatchResultItem, type BatchResults, type BatchStatus, BatchStore, type BatchUsageSummary, type ChatCompletion, type ChatCompletionChoice, type ChatCompletionChunk, type ChatCompletionRequest, type ChunkChoice, type ChunkDelta, type ContentPart, type CustomProviderConfig, type FinishReason, type GenerationStats, GenerationStatsStore, type Message, type ModelArchitecture, type ModelInfo, type ModelPricing, type ModelTopProvider, type NativeBatchStatus, type ProviderAdapter, type ProviderConfig, type ProviderPreferences, type ResponseFormat, type Role, type ServerOptions, type Tool, type ToolCall, type ToolChoice, type Usage, appendFileQueued, configureFsIO, createAnthropicBatchAdapter, createAnyModelServer, createGoogleBatchAdapter, createOpenAIBatchAdapter, ensureDir, estimateTokenCount, getFsQueueStatus, joinPath, readFileQueued, resolveConfig, resolveMaxTokens, startServer, waitForFsQueuesIdle, writeFileFlushedQueued, writeFileQueued };
|