@codeworksh/aikit 0.4.1-dev.20260530193930 → 0.4.1-dev.20260530194815
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/index.d.mts +58 -3
- package/index.mjs.map +1 -1
- package/package.json +1 -1
- package/registry-Cfdk78qk.mjs.map +1 -1
package/index.d.mts
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import Type$1, { Static, Static as Static$1, TSchema, TSchema as TSchema$1, Type, Type as Type$2 } from "typebox";
|
|
2
2
|
import { statSync } from "fs";
|
|
3
3
|
import { Readable } from "stream";
|
|
4
|
+
import { AnthropicLanguageModelOptions, AnthropicProviderSettings } from "@ai-sdk/anthropic";
|
|
5
|
+
import { GoogleGenerativeAIProviderSettings, GoogleLanguageModelOptions } from "@ai-sdk/google";
|
|
6
|
+
import { GoogleVertexProviderSettings } from "@ai-sdk/google-vertex";
|
|
7
|
+
import { GoogleVertexAnthropicProviderSettings } from "@ai-sdk/google-vertex/anthropic";
|
|
8
|
+
import { OpenAILanguageModelChatOptions, OpenAILanguageModelCompletionOptions, OpenAILanguageModelResponsesOptions, OpenAIProviderSettings } from "@ai-sdk/openai";
|
|
9
|
+
import { OpenAICompatibleLanguageModelChatOptions, OpenAICompatibleLanguageModelCompletionOptions, OpenAICompatibleProviderSettings } from "@ai-sdk/openai-compatible";
|
|
10
|
+
import { XaiLanguageModelChatOptions, XaiLanguageModelResponsesOptions, XaiProviderSettings } from "@ai-sdk/xai";
|
|
11
|
+
import { OpenRouterProviderOptions, OpenRouterProviderSettings } from "@openrouter/ai-sdk-provider";
|
|
4
12
|
|
|
5
13
|
//#region src/event/event.d.ts
|
|
6
14
|
declare namespace Event {
|
|
@@ -5478,7 +5486,8 @@ declare namespace Model {
|
|
|
5478
5486
|
reset(): void;
|
|
5479
5487
|
};
|
|
5480
5488
|
function supportsProtocol(model: Info, protocol: KnownProviderEnum): boolean;
|
|
5481
|
-
|
|
5489
|
+
type ProviderToProtocol<TProvider extends string> = TProvider extends KnownProviderEnum ? TProvider : KnownProviderEnum;
|
|
5490
|
+
function getModel<TProvider extends string, TProtocol extends KnownProviderEnum = ProviderToProtocol<TProvider>>(provider: TProvider, model: string, overrides?: Partial<Info> & {
|
|
5482
5491
|
protocol?: TProtocol;
|
|
5483
5492
|
}): Promise<TModel<TProtocol> | undefined>;
|
|
5484
5493
|
function getProviders(): Promise<string[]>;
|
|
@@ -5494,7 +5503,9 @@ declare namespace Model {
|
|
|
5494
5503
|
//#endregion
|
|
5495
5504
|
//#region src/llm.d.ts
|
|
5496
5505
|
type LLM = {
|
|
5497
|
-
<TProvider extends string,
|
|
5506
|
+
<TProvider extends string, TProtocol extends Model.KnownProviderEnum = Model.ProviderToProtocol<TProvider>>(provider: TProvider, model: string, overrides?: Partial<Model.Info> & {
|
|
5507
|
+
protocol?: TProtocol;
|
|
5508
|
+
}): Promise<Model.TModel<TProtocol> | undefined>;
|
|
5498
5509
|
model: typeof Model.getModel;
|
|
5499
5510
|
models: typeof Model.getModels;
|
|
5500
5511
|
providers: typeof Model.getProviders;
|
|
@@ -6582,6 +6593,41 @@ declare class AssistantMessageEventStream extends EventStream<Event.LLMMessageEv
|
|
|
6582
6593
|
/** Factory function for AssistantMessageEventStream (for use in extensions) */
|
|
6583
6594
|
declare function createAssistantMessageEventStream(): AssistantMessageEventStream;
|
|
6584
6595
|
//#endregion
|
|
6596
|
+
//#region src/llm/options.d.ts
|
|
6597
|
+
type ProviderOptionBag = Record<string, Record<string, unknown> | undefined>;
|
|
6598
|
+
type AISDKOptions<TFactoryOptions, TProviderOptions extends ProviderOptionBag = ProviderOptionBag> = Protocol.CommonOptions & {
|
|
6599
|
+
baseURL?: string;
|
|
6600
|
+
method?: Model.APIMethodEnum;
|
|
6601
|
+
modelId?: string;
|
|
6602
|
+
toolChoice?: unknown;
|
|
6603
|
+
activeTools?: string[];
|
|
6604
|
+
factoryOptions?: Partial<TFactoryOptions> & Record<string, unknown>;
|
|
6605
|
+
providerOptions?: TProviderOptions & ProviderOptionBag;
|
|
6606
|
+
};
|
|
6607
|
+
type OpenAILanguageOptions = OpenAILanguageModelResponsesOptions | OpenAILanguageModelChatOptions | OpenAILanguageModelCompletionOptions;
|
|
6608
|
+
type OpenAICompatibleLanguageOptions = OpenAICompatibleLanguageModelChatOptions | OpenAICompatibleLanguageModelCompletionOptions;
|
|
6609
|
+
type XaiLanguageOptions = XaiLanguageModelResponsesOptions | XaiLanguageModelChatOptions;
|
|
6610
|
+
type OpenAIOptions = AISDKOptions<OpenAIProviderSettings, {
|
|
6611
|
+
openai?: OpenAILanguageOptions;
|
|
6612
|
+
}>;
|
|
6613
|
+
type AnthropicOptions = AISDKOptions<AnthropicProviderSettings, {
|
|
6614
|
+
anthropic?: AnthropicLanguageModelOptions;
|
|
6615
|
+
}>;
|
|
6616
|
+
type GoogleOptions = AISDKOptions<GoogleGenerativeAIProviderSettings, {
|
|
6617
|
+
google?: GoogleLanguageModelOptions;
|
|
6618
|
+
}>;
|
|
6619
|
+
type GoogleVertexOptions = AISDKOptions<GoogleVertexProviderSettings>;
|
|
6620
|
+
type GoogleVertexAnthropicOptions = AISDKOptions<GoogleVertexAnthropicProviderSettings>;
|
|
6621
|
+
type OpenAICompatibleOptions = AISDKOptions<OpenAICompatibleProviderSettings, {
|
|
6622
|
+
"openai-compatible"?: OpenAICompatibleLanguageOptions;
|
|
6623
|
+
}>;
|
|
6624
|
+
type OpenRouterOptions = AISDKOptions<OpenRouterProviderSettings, {
|
|
6625
|
+
openrouter?: OpenRouterProviderOptions;
|
|
6626
|
+
}>;
|
|
6627
|
+
type XaiOptions = AISDKOptions<XaiProviderSettings, {
|
|
6628
|
+
xai?: XaiLanguageOptions;
|
|
6629
|
+
}>;
|
|
6630
|
+
//#endregion
|
|
6585
6631
|
//#region src/llm/shared.d.ts
|
|
6586
6632
|
declare const ThinkingBudgets: Type$2.TObject<{
|
|
6587
6633
|
minimal: Type$2.TOptional<Type$2.TNumber>;
|
|
@@ -7063,7 +7109,16 @@ declare namespace Protocol {
|
|
|
7063
7109
|
reasoning?: Model.ActiveThinkingLevel;
|
|
7064
7110
|
thinkingBudgets?: ThinkingBudgets;
|
|
7065
7111
|
};
|
|
7066
|
-
export interface OptionsByProtocol {
|
|
7112
|
+
export interface OptionsByProtocol {
|
|
7113
|
+
[Model.KnownProviderEnum.openai]: OpenAIOptions;
|
|
7114
|
+
[Model.KnownProviderEnum.anthropic]: AnthropicOptions;
|
|
7115
|
+
[Model.KnownProviderEnum.google]: GoogleOptions;
|
|
7116
|
+
[Model.KnownProviderEnum.googleVertex]: GoogleVertexOptions;
|
|
7117
|
+
[Model.KnownProviderEnum.googleVertexAnthropic]: GoogleVertexAnthropicOptions;
|
|
7118
|
+
[Model.KnownProviderEnum.openaiCompatible]: OpenAICompatibleOptions;
|
|
7119
|
+
[Model.KnownProviderEnum.openrouter]: OpenRouterOptions;
|
|
7120
|
+
[Model.KnownProviderEnum.xai]: XaiOptions;
|
|
7121
|
+
}
|
|
7067
7122
|
export type ProtocolWithOptions = keyof OptionsByProtocol & Model.KnownProviderEnum;
|
|
7068
7123
|
export type OptionsFor<TProtocol extends ProtocolWithOptions> = OptionsByProtocol[TProtocol];
|
|
7069
7124
|
export type StreamFunction<TProtocol extends Model.KnownProviderEnum = Model.KnownProviderEnum, S extends TSchema$1 = TSchema$1> = (model: Model.TModel<TProtocol>, context: Message.Context, options?: Static$1<S>) => AssistantMessageEventStream;
|