@codelia/core 0.1.33 → 0.1.35
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.cjs +497 -222
- package/dist/index.d.cts +19 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +497 -222
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -229,6 +229,7 @@ interface BaseChatModel<P extends ProviderName = ProviderName, O = unknown> {
|
|
|
229
229
|
ainvoke(input: ChatInvokeInput & {
|
|
230
230
|
options?: O;
|
|
231
231
|
}, context?: ChatInvokeContext): Promise<ChatInvokeCompletion>;
|
|
232
|
+
onHistoryCompacted?(context?: ChatInvokeContext): void | Promise<void>;
|
|
232
233
|
}
|
|
233
234
|
|
|
234
235
|
type ModelSpec = {
|
|
@@ -622,12 +623,19 @@ type ChatAnthropicOptions = {
|
|
|
622
623
|
clientOptions?: ConstructorParameters<typeof Anthropic>[0];
|
|
623
624
|
model?: string;
|
|
624
625
|
maxTokens?: number;
|
|
626
|
+
invokeOptions?: AnthropicInvokeOptions;
|
|
627
|
+
reasoningLevelRequested?: "low" | "medium" | "high" | "xhigh";
|
|
628
|
+
reasoningLevelApplied?: "low" | "medium" | "high" | "xhigh";
|
|
629
|
+
reasoningFallbackApplied?: boolean;
|
|
630
|
+
reasoningBudgetPreset?: string;
|
|
625
631
|
};
|
|
626
632
|
declare class ChatAnthropic implements BaseChatModel<typeof PROVIDER_NAME$2, AnthropicInvokeOptions> {
|
|
627
633
|
readonly provider: typeof PROVIDER_NAME$2;
|
|
628
634
|
readonly model: string;
|
|
629
635
|
private readonly client;
|
|
630
636
|
private readonly defaultMaxTokens;
|
|
637
|
+
private readonly defaultInvokeOptions;
|
|
638
|
+
private readonly reasoningLevelMeta;
|
|
631
639
|
private debugInvokeSeq;
|
|
632
640
|
private lastDebugRequestPayload;
|
|
633
641
|
constructor(options?: ChatAnthropicOptions);
|
|
@@ -657,12 +665,16 @@ type OpenAIInvokeOptions = Omit<ResponseCreateParamsBase, "model" | "input" | "t
|
|
|
657
665
|
reasoningEffort?: ReasoningEffort;
|
|
658
666
|
textVerbosity?: OpenAITextVerbosity;
|
|
659
667
|
};
|
|
668
|
+
type OpenAIReasoningLevel = "low" | "medium" | "high" | "xhigh";
|
|
660
669
|
|
|
661
670
|
type ChatOpenAIOptions = {
|
|
662
671
|
client?: OpenAI;
|
|
663
672
|
clientOptions?: ClientOptions;
|
|
664
673
|
model?: string;
|
|
665
674
|
reasoningEffort?: ReasoningEffort;
|
|
675
|
+
reasoningLevelRequested?: OpenAIReasoningLevel;
|
|
676
|
+
reasoningLevelApplied?: OpenAIReasoningLevel;
|
|
677
|
+
reasoningFallbackApplied?: boolean;
|
|
666
678
|
textVerbosity?: OpenAITextVerbosity;
|
|
667
679
|
websocketMode?: OpenAiWebsocketMode;
|
|
668
680
|
websocketApiVersion?: OpenAiWebsocketApiVersion;
|
|
@@ -675,6 +687,7 @@ declare class ChatOpenAI implements BaseChatModel<typeof PROVIDER_NAME$1, OpenAI
|
|
|
675
687
|
readonly model: string;
|
|
676
688
|
private readonly client;
|
|
677
689
|
private readonly defaultReasoningEffort?;
|
|
690
|
+
private readonly reasoningLevelMeta;
|
|
678
691
|
private readonly defaultTextVerbosity?;
|
|
679
692
|
private readonly websocketMode;
|
|
680
693
|
private readonly websocketApiVersion;
|
|
@@ -688,6 +701,7 @@ declare class ChatOpenAI implements BaseChatModel<typeof PROVIDER_NAME$1, OpenAI
|
|
|
688
701
|
ainvoke(input: ChatInvokeInput & {
|
|
689
702
|
options?: OpenAIInvokeOptions;
|
|
690
703
|
}, context?: ChatInvokeContext): Promise<ChatInvokeCompletion>;
|
|
704
|
+
onHistoryCompacted(context?: ChatInvokeContext): void;
|
|
691
705
|
private invokeWithTransport;
|
|
692
706
|
private invokeHttpTransportWithDebug;
|
|
693
707
|
private persistWsSessionState;
|
|
@@ -714,11 +728,15 @@ type OpenRouterInvokeOptions = Omit<ResponseCreateParamsBase, "model" | "input"
|
|
|
714
728
|
reasoningEffort?: ReasoningEffort;
|
|
715
729
|
textVerbosity?: OpenRouterTextVerbosity;
|
|
716
730
|
};
|
|
731
|
+
type OpenRouterReasoningLevel = "low" | "medium" | "high" | "xhigh";
|
|
717
732
|
type ChatOpenRouterOptions = {
|
|
718
733
|
client?: OpenAI;
|
|
719
734
|
clientOptions?: ClientOptions;
|
|
720
735
|
model?: string;
|
|
721
736
|
reasoningEffort?: ReasoningEffort;
|
|
737
|
+
reasoningLevelRequested?: OpenRouterReasoningLevel;
|
|
738
|
+
reasoningLevelApplied?: OpenRouterReasoningLevel;
|
|
739
|
+
reasoningFallbackApplied?: boolean;
|
|
722
740
|
textVerbosity?: OpenRouterTextVerbosity;
|
|
723
741
|
};
|
|
724
742
|
declare class ChatOpenRouter implements BaseChatModel<typeof PROVIDER_NAME, OpenRouterInvokeOptions> {
|
|
@@ -726,6 +744,7 @@ declare class ChatOpenRouter implements BaseChatModel<typeof PROVIDER_NAME, Open
|
|
|
726
744
|
readonly model: string;
|
|
727
745
|
private readonly client;
|
|
728
746
|
private readonly defaultReasoningEffort?;
|
|
747
|
+
private readonly reasoningLevelMeta;
|
|
729
748
|
private readonly defaultTextVerbosity?;
|
|
730
749
|
private debugInvokeSeq;
|
|
731
750
|
private lastDebugRequestPayload;
|
package/dist/index.d.ts
CHANGED
|
@@ -229,6 +229,7 @@ interface BaseChatModel<P extends ProviderName = ProviderName, O = unknown> {
|
|
|
229
229
|
ainvoke(input: ChatInvokeInput & {
|
|
230
230
|
options?: O;
|
|
231
231
|
}, context?: ChatInvokeContext): Promise<ChatInvokeCompletion>;
|
|
232
|
+
onHistoryCompacted?(context?: ChatInvokeContext): void | Promise<void>;
|
|
232
233
|
}
|
|
233
234
|
|
|
234
235
|
type ModelSpec = {
|
|
@@ -622,12 +623,19 @@ type ChatAnthropicOptions = {
|
|
|
622
623
|
clientOptions?: ConstructorParameters<typeof Anthropic>[0];
|
|
623
624
|
model?: string;
|
|
624
625
|
maxTokens?: number;
|
|
626
|
+
invokeOptions?: AnthropicInvokeOptions;
|
|
627
|
+
reasoningLevelRequested?: "low" | "medium" | "high" | "xhigh";
|
|
628
|
+
reasoningLevelApplied?: "low" | "medium" | "high" | "xhigh";
|
|
629
|
+
reasoningFallbackApplied?: boolean;
|
|
630
|
+
reasoningBudgetPreset?: string;
|
|
625
631
|
};
|
|
626
632
|
declare class ChatAnthropic implements BaseChatModel<typeof PROVIDER_NAME$2, AnthropicInvokeOptions> {
|
|
627
633
|
readonly provider: typeof PROVIDER_NAME$2;
|
|
628
634
|
readonly model: string;
|
|
629
635
|
private readonly client;
|
|
630
636
|
private readonly defaultMaxTokens;
|
|
637
|
+
private readonly defaultInvokeOptions;
|
|
638
|
+
private readonly reasoningLevelMeta;
|
|
631
639
|
private debugInvokeSeq;
|
|
632
640
|
private lastDebugRequestPayload;
|
|
633
641
|
constructor(options?: ChatAnthropicOptions);
|
|
@@ -657,12 +665,16 @@ type OpenAIInvokeOptions = Omit<ResponseCreateParamsBase, "model" | "input" | "t
|
|
|
657
665
|
reasoningEffort?: ReasoningEffort;
|
|
658
666
|
textVerbosity?: OpenAITextVerbosity;
|
|
659
667
|
};
|
|
668
|
+
type OpenAIReasoningLevel = "low" | "medium" | "high" | "xhigh";
|
|
660
669
|
|
|
661
670
|
type ChatOpenAIOptions = {
|
|
662
671
|
client?: OpenAI;
|
|
663
672
|
clientOptions?: ClientOptions;
|
|
664
673
|
model?: string;
|
|
665
674
|
reasoningEffort?: ReasoningEffort;
|
|
675
|
+
reasoningLevelRequested?: OpenAIReasoningLevel;
|
|
676
|
+
reasoningLevelApplied?: OpenAIReasoningLevel;
|
|
677
|
+
reasoningFallbackApplied?: boolean;
|
|
666
678
|
textVerbosity?: OpenAITextVerbosity;
|
|
667
679
|
websocketMode?: OpenAiWebsocketMode;
|
|
668
680
|
websocketApiVersion?: OpenAiWebsocketApiVersion;
|
|
@@ -675,6 +687,7 @@ declare class ChatOpenAI implements BaseChatModel<typeof PROVIDER_NAME$1, OpenAI
|
|
|
675
687
|
readonly model: string;
|
|
676
688
|
private readonly client;
|
|
677
689
|
private readonly defaultReasoningEffort?;
|
|
690
|
+
private readonly reasoningLevelMeta;
|
|
678
691
|
private readonly defaultTextVerbosity?;
|
|
679
692
|
private readonly websocketMode;
|
|
680
693
|
private readonly websocketApiVersion;
|
|
@@ -688,6 +701,7 @@ declare class ChatOpenAI implements BaseChatModel<typeof PROVIDER_NAME$1, OpenAI
|
|
|
688
701
|
ainvoke(input: ChatInvokeInput & {
|
|
689
702
|
options?: OpenAIInvokeOptions;
|
|
690
703
|
}, context?: ChatInvokeContext): Promise<ChatInvokeCompletion>;
|
|
704
|
+
onHistoryCompacted(context?: ChatInvokeContext): void;
|
|
691
705
|
private invokeWithTransport;
|
|
692
706
|
private invokeHttpTransportWithDebug;
|
|
693
707
|
private persistWsSessionState;
|
|
@@ -714,11 +728,15 @@ type OpenRouterInvokeOptions = Omit<ResponseCreateParamsBase, "model" | "input"
|
|
|
714
728
|
reasoningEffort?: ReasoningEffort;
|
|
715
729
|
textVerbosity?: OpenRouterTextVerbosity;
|
|
716
730
|
};
|
|
731
|
+
type OpenRouterReasoningLevel = "low" | "medium" | "high" | "xhigh";
|
|
717
732
|
type ChatOpenRouterOptions = {
|
|
718
733
|
client?: OpenAI;
|
|
719
734
|
clientOptions?: ClientOptions;
|
|
720
735
|
model?: string;
|
|
721
736
|
reasoningEffort?: ReasoningEffort;
|
|
737
|
+
reasoningLevelRequested?: OpenRouterReasoningLevel;
|
|
738
|
+
reasoningLevelApplied?: OpenRouterReasoningLevel;
|
|
739
|
+
reasoningFallbackApplied?: boolean;
|
|
722
740
|
textVerbosity?: OpenRouterTextVerbosity;
|
|
723
741
|
};
|
|
724
742
|
declare class ChatOpenRouter implements BaseChatModel<typeof PROVIDER_NAME, OpenRouterInvokeOptions> {
|
|
@@ -726,6 +744,7 @@ declare class ChatOpenRouter implements BaseChatModel<typeof PROVIDER_NAME, Open
|
|
|
726
744
|
readonly model: string;
|
|
727
745
|
private readonly client;
|
|
728
746
|
private readonly defaultReasoningEffort?;
|
|
747
|
+
private readonly reasoningLevelMeta;
|
|
729
748
|
private readonly defaultTextVerbosity?;
|
|
730
749
|
private debugInvokeSeq;
|
|
731
750
|
private lastDebugRequestPayload;
|