@crewai-ts/core 0.1.2 → 0.1.5
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/a2a.d.ts +1684 -0
- package/dist/a2ui-schemas.d.ts +3312 -0
- package/dist/a2ui.d.ts +379 -0
- package/dist/agent-adapters.d.ts +178 -0
- package/dist/agent-executors.d.ts +508 -0
- package/dist/agent-parser.d.ts +44 -0
- package/dist/agent-planning.d.ts +358 -0
- package/dist/agent-utils.d.ts +210 -0
- package/dist/agent.d.ts +444 -0
- package/dist/auth.d.ts +179 -0
- package/dist/config-utils.d.ts +5 -0
- package/dist/content-processor.d.ts +12 -0
- package/dist/context.d.ts +157 -0
- package/dist/converter.d.ts +97 -0
- package/dist/crew-chat.d.ts +97 -0
- package/dist/crew.d.ts +424 -0
- package/dist/decorators.d.ts +20 -0
- package/dist/env.d.ts +13 -0
- package/dist/errors.d.ts +27 -0
- package/dist/evaluators.d.ts +477 -0
- package/dist/events.d.ts +2657 -0
- package/dist/execution-utils.d.ts +85 -0
- package/dist/experimental-conversational.d.ts +181 -0
- package/dist/file-handler.d.ts +36 -0
- package/dist/file-store.d.ts +37 -0
- package/dist/files.d.ts +554 -0
- package/dist/flow-conversation.d.ts +90 -0
- package/dist/flow-definition.d.ts +195 -0
- package/dist/flow-persistence.d.ts +107 -0
- package/dist/flow-visualization.d.ts +77 -0
- package/dist/flow.d.ts +927 -0
- package/dist/formatter.d.ts +7 -0
- package/dist/guardrail.d.ts +95 -0
- package/dist/hooks.d.ts +241 -0
- package/dist/human-input.d.ts +74 -0
- package/dist/i18n.d.ts +26 -0
- package/dist/index.cjs +83 -36
- package/dist/index.d.ts +99 -13004
- package/dist/index.js +82 -36
- package/dist/input-files.d.ts +24 -0
- package/dist/input-provider.d.ts +22 -0
- package/dist/knowledge.d.ts +353 -0
- package/dist/lite-agent-output.d.ts +69 -0
- package/dist/lite-agent.d.ts +154 -0
- package/dist/llm.d.ts +630 -0
- package/dist/llms-hooks-transport.d.ts +1 -2
- package/dist/lock-store.d.ts +14 -0
- package/dist/logger.d.ts +55 -0
- package/dist/mcp.d.ts +315 -0
- package/dist/memory.d.ts +915 -0
- package/dist/metadata.d.ts +9 -0
- package/dist/misc-compat.d.ts +125 -0
- package/dist/openai-completion.d.ts +324 -0
- package/dist/outputs.d.ts +69 -0
- package/dist/planning.d.ts +60 -0
- package/dist/plus-api.d.ts +194 -0
- package/dist/project-compat.d.ts +133 -0
- package/dist/project.d.ts +221 -0
- package/dist/prompts.d.ts +66 -0
- package/dist/provider-completions.d.ts +593 -0
- package/dist/rag.d.ts +1074 -0
- package/dist/rpm.d.ts +27 -0
- package/dist/rw-lock.d.ts +21 -0
- package/dist/schema-utils.d.ts +121 -0
- package/dist/security.d.ts +66 -0
- package/dist/settings.d.ts +103 -0
- package/dist/skills.d.ts +145 -0
- package/dist/state-provider-core.d.ts +1 -1
- package/dist/state.d.ts +204 -0
- package/dist/step-execution-context.d.ts +36 -0
- package/dist/streaming.d.ts +153 -0
- package/dist/string-utils.d.ts +12 -0
- package/dist/task-output-storage.d.ts +62 -0
- package/dist/task.d.ts +305 -0
- package/dist/telemetry.d.ts +91 -0
- package/dist/token-counter-callback.d.ts +36 -0
- package/dist/tools.d.ts +563 -0
- package/dist/tracing-utils.d.ts +56 -0
- package/dist/training-converter.d.ts +36 -0
- package/dist/training-handler.d.ts +10 -0
- package/dist/types.d.ts +72 -0
- package/dist/utilities.d.ts +130 -0
- package/dist/utility-types.d.ts +10 -0
- package/dist/version.d.ts +12 -0
- package/package.json +326 -4904
- package/dist/index.d.cts +0 -13068
- package/dist/llms-hooks-transport-ChGiFBiU.d.ts +0 -233
- package/dist/llms-hooks-transport-DZlurMUQ.d.cts +0 -233
- package/dist/llms-hooks-transport.d.cts +0 -2
- package/dist/state-provider-core-Be9RKRAm.d.cts +0 -4876
- package/dist/state-provider-core-Be9RKRAm.d.ts +0 -4876
- package/dist/state-provider-core.d.cts +0 -1
|
@@ -0,0 +1,593 @@
|
|
|
1
|
+
import { ConfiguredLLM, LocalFileUploader, type BaseLLMOptions, type LLMAvailableFunction, type LLMCallOptions, type LLMMessageInput, type LLMResponse } from "./llm.js";
|
|
2
|
+
import { OpenAICompletion, type OpenAICompletionOptions } from "./openai-completion.js";
|
|
3
|
+
import type { LLMMessage, Tool } from "./types.js";
|
|
4
|
+
export declare const TOOL_SEARCH_TOOL_TYPES: readonly ["tool_search_tool_regex_20251119", "tool_search_tool_bm25_20251119"];
|
|
5
|
+
export declare const ANTHROPIC_FILES_API_BETA = "files-api-2025-04-14";
|
|
6
|
+
export declare const ANTHROPIC_STRUCTURED_OUTPUTS_BETA = "structured-outputs-2025-11-13";
|
|
7
|
+
export declare const NATIVE_STRUCTURED_OUTPUT_MODELS: readonly ["claude-sonnet-4-5", "claude-sonnet-4.5", "claude-opus-4-5", "claude-opus-4.5", "claude-opus-4-1", "claude-opus-4.1", "claude-haiku-4-5", "claude-haiku-4.5"];
|
|
8
|
+
export declare const SNOWFLAKE_CORTEX_PATH = "/api/v2/cortex/v1";
|
|
9
|
+
export declare const SNOWFLAKE_TOKEN_ENV_VARS: readonly ["SNOWFLAKE_PAT", "SNOWFLAKE_TOKEN", "SNOWFLAKE_JWT"];
|
|
10
|
+
export type AnthropicThinkingConfigOptions = {
|
|
11
|
+
type: "enabled" | "disabled";
|
|
12
|
+
budget_tokens?: number | null;
|
|
13
|
+
budgetTokens?: number | null;
|
|
14
|
+
};
|
|
15
|
+
export declare class AnthropicThinkingConfig {
|
|
16
|
+
readonly type: "enabled" | "disabled";
|
|
17
|
+
readonly budget_tokens: number | null;
|
|
18
|
+
readonly budgetTokens: number | null;
|
|
19
|
+
constructor(options: AnthropicThinkingConfigOptions);
|
|
20
|
+
}
|
|
21
|
+
export type AnthropicToolSearchConfigOptions = {
|
|
22
|
+
type?: "regex" | "bm25";
|
|
23
|
+
};
|
|
24
|
+
export declare class AnthropicToolSearchConfig {
|
|
25
|
+
readonly type: "regex" | "bm25";
|
|
26
|
+
constructor(options?: AnthropicToolSearchConfigOptions);
|
|
27
|
+
}
|
|
28
|
+
export type AnthropicCompletionOptions = BaseLLMOptions & {
|
|
29
|
+
timeout?: number | null;
|
|
30
|
+
max_retries?: number;
|
|
31
|
+
maxRetries?: number;
|
|
32
|
+
max_tokens?: number | null;
|
|
33
|
+
maxTokens?: number | null;
|
|
34
|
+
top_p?: number | null;
|
|
35
|
+
topP?: number | null;
|
|
36
|
+
stream?: boolean;
|
|
37
|
+
client_params?: Record<string, unknown> | null;
|
|
38
|
+
clientParams?: Record<string, unknown> | null;
|
|
39
|
+
interceptor?: unknown;
|
|
40
|
+
thinking?: AnthropicThinkingConfig | AnthropicThinkingConfigOptions | null;
|
|
41
|
+
tool_search?: AnthropicToolSearchConfig | AnthropicToolSearchConfigOptions | boolean | null;
|
|
42
|
+
toolSearch?: AnthropicToolSearchConfig | AnthropicToolSearchConfigOptions | boolean | null;
|
|
43
|
+
};
|
|
44
|
+
export declare class AnthropicCompletion extends ConfiguredLLM {
|
|
45
|
+
readonly timeout: number | null;
|
|
46
|
+
readonly maxRetries: number;
|
|
47
|
+
readonly max_retries: number;
|
|
48
|
+
readonly maxTokens: number;
|
|
49
|
+
readonly max_tokens: number;
|
|
50
|
+
readonly topP: number | null;
|
|
51
|
+
readonly top_p: number | null;
|
|
52
|
+
readonly stream: boolean;
|
|
53
|
+
readonly clientParams: Record<string, unknown> | null;
|
|
54
|
+
readonly client_params: Record<string, unknown> | null;
|
|
55
|
+
readonly interceptor: unknown;
|
|
56
|
+
readonly thinking: AnthropicThinkingConfig | null;
|
|
57
|
+
readonly toolSearch: AnthropicToolSearchConfig | null;
|
|
58
|
+
readonly tool_search: AnthropicToolSearchConfig | null;
|
|
59
|
+
readonly isClaude3: boolean;
|
|
60
|
+
readonly is_claude_3: boolean;
|
|
61
|
+
readonly supportsTools: boolean;
|
|
62
|
+
readonly supports_tools: boolean;
|
|
63
|
+
previousThinkingBlocks: Record<string, unknown>[];
|
|
64
|
+
_previous_thinking_blocks: Record<string, unknown>[];
|
|
65
|
+
constructor(options?: AnthropicCompletionOptions);
|
|
66
|
+
call(messages: readonly LLMMessage[], options?: LLMCallOptions): Promise<LLMResponse>;
|
|
67
|
+
acall(messages: LLMMessageInput, options?: LLMCallOptions): Promise<LLMResponse>;
|
|
68
|
+
static convertImageBlocks(content: unknown): unknown;
|
|
69
|
+
static _convert_image_blocks(content: unknown): unknown;
|
|
70
|
+
formatMessagesForAnthropic(messages: LLMMessageInput): [Record<string, unknown>[], string | Record<string, unknown>[] | null];
|
|
71
|
+
_format_messages_for_anthropic(messages: LLMMessageInput): [Record<string, unknown>[], string | Record<string, unknown>[] | null];
|
|
72
|
+
static stampCacheControlOnMessage(message: Record<string, unknown>): void;
|
|
73
|
+
prepareCompletionParams(messages: readonly LLMMessage[], systemMessage?: string | readonly Record<string, unknown>[] | null, tools?: readonly Tool[] | null, availableFunctions?: Record<string, unknown> | null): Record<string, unknown>;
|
|
74
|
+
_prepare_completion_params(messages: readonly LLMMessage[], systemMessage?: string | readonly Record<string, unknown>[] | null, tools?: readonly Tool[] | null, availableFunctions?: Record<string, unknown> | null): Record<string, unknown>;
|
|
75
|
+
convertToolsForInterference(tools: readonly Tool[]): Record<string, unknown>[];
|
|
76
|
+
_convert_tools_for_interference(tools: readonly Tool[]): Record<string, unknown>[];
|
|
77
|
+
applyToolSearch(tools: readonly Record<string, unknown>[]): Record<string, unknown>[];
|
|
78
|
+
_apply_tool_search(tools: readonly Record<string, unknown>[]): Record<string, unknown>[];
|
|
79
|
+
extractAnthropicTokenUsage(response: unknown): Record<string, number>;
|
|
80
|
+
_extract_anthropic_token_usage(response: unknown): Record<string, number>;
|
|
81
|
+
static extractAnthropicTokenUsage(response: unknown): Record<string, number>;
|
|
82
|
+
static _extract_anthropic_token_usage(response: unknown): Record<string, number>;
|
|
83
|
+
static extractToolUsesFromResponse(response: unknown): Record<string, unknown>[];
|
|
84
|
+
static extract_tool_uses_from_response(response: unknown): Record<string, unknown>[];
|
|
85
|
+
static extractStructuredOutputFromResponse(response: unknown): Record<string, unknown> | null;
|
|
86
|
+
static extract_structured_output_from_response(response: unknown): Record<string, unknown> | null;
|
|
87
|
+
static extractThinkingBlocksFromResponse(response: unknown): Record<string, unknown>[];
|
|
88
|
+
static extract_thinking_blocks_from_response(response: unknown): Record<string, unknown>[];
|
|
89
|
+
accumulateStreamEvents(events: readonly unknown[], finalMessage?: unknown): {
|
|
90
|
+
text: string;
|
|
91
|
+
response_id: string | null;
|
|
92
|
+
tool_calls: Record<string, unknown>[];
|
|
93
|
+
usage: Record<string, number> | null;
|
|
94
|
+
thinking_blocks: Record<string, unknown>[];
|
|
95
|
+
};
|
|
96
|
+
_accumulate_stream_events(events: readonly unknown[], finalMessage?: unknown): {
|
|
97
|
+
text: string;
|
|
98
|
+
response_id: string | null;
|
|
99
|
+
tool_calls: Record<string, unknown>[];
|
|
100
|
+
usage: Record<string, number> | null;
|
|
101
|
+
thinking_blocks: Record<string, unknown>[];
|
|
102
|
+
};
|
|
103
|
+
executeToolsAndCollectResults(toolUses: readonly unknown[], availableFunctions: Record<string, LLMAvailableFunction>): Promise<Record<string, unknown>[]>;
|
|
104
|
+
_execute_tools_and_collect_results(toolUses: readonly unknown[], availableFunctions: Record<string, LLMAvailableFunction>): Promise<Record<string, unknown>[]>;
|
|
105
|
+
executeFirstTool(toolUses: readonly unknown[], availableFunctions: Record<string, LLMAvailableFunction>): Promise<string | null>;
|
|
106
|
+
_execute_first_tool(toolUses: readonly unknown[], availableFunctions: Record<string, LLMAvailableFunction>): Promise<string | null>;
|
|
107
|
+
supportsFunctionCalling(): boolean;
|
|
108
|
+
supports_function_calling(): boolean;
|
|
109
|
+
supportsStopWords(): boolean;
|
|
110
|
+
supports_stop_words(): boolean;
|
|
111
|
+
supportsMultimodal(): boolean;
|
|
112
|
+
supports_multimodal(): boolean;
|
|
113
|
+
getFileUploader(): LocalFileUploader;
|
|
114
|
+
get_file_uploader(): LocalFileUploader;
|
|
115
|
+
getContextWindowSize(): number;
|
|
116
|
+
get_context_window_size(): number;
|
|
117
|
+
toConfigDict(): Record<string, unknown>;
|
|
118
|
+
to_config_dict(): Record<string, unknown>;
|
|
119
|
+
}
|
|
120
|
+
export declare const STRUCTURED_OUTPUT_TOOL_NAME = "structured_output";
|
|
121
|
+
export declare const ToolInputSchema: Readonly<{
|
|
122
|
+
kind: "ToolInputSchema";
|
|
123
|
+
}>;
|
|
124
|
+
export declare const ToolSpec: Readonly<{
|
|
125
|
+
kind: "ToolSpec";
|
|
126
|
+
}>;
|
|
127
|
+
export declare const ConverseToolTypeDef: Readonly<{
|
|
128
|
+
kind: "ConverseToolTypeDef";
|
|
129
|
+
}>;
|
|
130
|
+
export declare const BedrockConverseRequestBody: Readonly<{
|
|
131
|
+
kind: "BedrockConverseRequestBody";
|
|
132
|
+
}>;
|
|
133
|
+
export declare const BedrockConverseStreamRequestBody: Readonly<{
|
|
134
|
+
kind: "BedrockConverseStreamRequestBody";
|
|
135
|
+
}>;
|
|
136
|
+
export type BedrockCompletionOptions = BaseLLMOptions & {
|
|
137
|
+
region_name?: string | null;
|
|
138
|
+
regionName?: string | null;
|
|
139
|
+
session?: unknown;
|
|
140
|
+
timeout?: number | null;
|
|
141
|
+
max_retries?: number;
|
|
142
|
+
maxRetries?: number;
|
|
143
|
+
max_tokens?: number | null;
|
|
144
|
+
maxTokens?: number | null;
|
|
145
|
+
top_p?: number | null;
|
|
146
|
+
topP?: number | null;
|
|
147
|
+
top_k?: number | null;
|
|
148
|
+
topK?: number | null;
|
|
149
|
+
stream?: boolean;
|
|
150
|
+
guardrail_config?: Record<string, unknown> | null;
|
|
151
|
+
guardrailConfig?: Record<string, unknown> | null;
|
|
152
|
+
additional_model_request_fields?: Record<string, unknown> | null;
|
|
153
|
+
additionalModelRequestFields?: Record<string, unknown> | null;
|
|
154
|
+
additional_model_response_field_paths?: string[] | null;
|
|
155
|
+
additionalModelResponseFieldPaths?: string[] | null;
|
|
156
|
+
interceptor?: unknown;
|
|
157
|
+
};
|
|
158
|
+
export declare class BedrockCompletion extends ConfiguredLLM {
|
|
159
|
+
readonly regionName: string | null;
|
|
160
|
+
readonly region_name: string | null;
|
|
161
|
+
readonly session: unknown;
|
|
162
|
+
readonly timeout: number | null;
|
|
163
|
+
readonly maxRetries: number;
|
|
164
|
+
readonly max_retries: number;
|
|
165
|
+
readonly maxTokens: number | null;
|
|
166
|
+
readonly max_tokens: number | null;
|
|
167
|
+
readonly topP: number | null;
|
|
168
|
+
readonly top_p: number | null;
|
|
169
|
+
readonly topK: number | null;
|
|
170
|
+
readonly top_k: number | null;
|
|
171
|
+
readonly stream: boolean;
|
|
172
|
+
readonly guardrailConfig: Record<string, unknown> | null;
|
|
173
|
+
readonly guardrail_config: Record<string, unknown> | null;
|
|
174
|
+
readonly additionalModelRequestFields: Record<string, unknown> | null;
|
|
175
|
+
readonly additional_model_request_fields: Record<string, unknown> | null;
|
|
176
|
+
readonly additionalModelResponseFieldPaths: string[] | null;
|
|
177
|
+
readonly additional_model_response_field_paths: string[] | null;
|
|
178
|
+
readonly interceptor: unknown;
|
|
179
|
+
constructor(options?: BedrockCompletionOptions);
|
|
180
|
+
call(messages: readonly LLMMessage[], options?: LLMCallOptions): Promise<LLMResponse>;
|
|
181
|
+
acall(messages: LLMMessageInput, options?: LLMCallOptions): Promise<LLMResponse>;
|
|
182
|
+
supportsFunctionCalling(): boolean;
|
|
183
|
+
supports_function_calling(): boolean;
|
|
184
|
+
supportsStopWords(): boolean;
|
|
185
|
+
supports_stop_words(): boolean;
|
|
186
|
+
supportsMultimodal(): boolean;
|
|
187
|
+
supports_multimodal(): boolean;
|
|
188
|
+
getContextWindowSize(): number;
|
|
189
|
+
get_context_window_size(): number;
|
|
190
|
+
formatTextContent(text: string): Record<string, string>;
|
|
191
|
+
format_text_content(text: string): Record<string, string>;
|
|
192
|
+
getDocumentFormat(contentType: string): string | null;
|
|
193
|
+
_get_document_format(contentType: string): string | null;
|
|
194
|
+
getVideoFormat(contentType: string): string | null;
|
|
195
|
+
_get_video_format(contentType: string): string | null;
|
|
196
|
+
handleClientError(error: unknown): string;
|
|
197
|
+
_handle_client_error(error: unknown): string;
|
|
198
|
+
getFileUploader(): LocalFileUploader;
|
|
199
|
+
get_file_uploader(): LocalFileUploader;
|
|
200
|
+
toConfigDict(): Record<string, unknown>;
|
|
201
|
+
to_config_dict(): Record<string, unknown>;
|
|
202
|
+
formatMessagesForConverse(messages: string | readonly (Partial<LLMMessage> & Record<string, unknown>)[]): {
|
|
203
|
+
messages: Record<string, unknown>[];
|
|
204
|
+
systemMessage: string | null;
|
|
205
|
+
system_message: string | null;
|
|
206
|
+
};
|
|
207
|
+
_format_messages_for_converse(messages: string | readonly (Partial<LLMMessage> & Record<string, unknown>)[]): [Record<string, unknown>[], string | null];
|
|
208
|
+
getInferenceConfig(): Record<string, unknown>;
|
|
209
|
+
_get_inference_config(): Record<string, unknown>;
|
|
210
|
+
formatToolsForConverse(tools: readonly Tool[]): Record<string, unknown>[];
|
|
211
|
+
_format_tools_for_converse(tools: readonly Tool[]): Record<string, unknown>[];
|
|
212
|
+
messagesContainToolContent(messages: readonly Record<string, unknown>[]): boolean;
|
|
213
|
+
_messages_contain_tool_content(messages: readonly Record<string, unknown>[]): boolean;
|
|
214
|
+
extractToolsFromMessageHistory(messages: readonly Record<string, unknown>[]): Record<string, unknown>[];
|
|
215
|
+
_extract_tools_from_message_history(messages: readonly Record<string, unknown>[]): Record<string, unknown>[];
|
|
216
|
+
prepareConverseRequestBody(messages: string | readonly (Partial<LLMMessage> & Record<string, unknown>)[], tools?: readonly Tool[] | null): {
|
|
217
|
+
messages: Record<string, unknown>[];
|
|
218
|
+
body: Record<string, unknown>;
|
|
219
|
+
systemMessage: string | null;
|
|
220
|
+
system_message: string | null;
|
|
221
|
+
};
|
|
222
|
+
_prepare_converse_request_body(messages: string | readonly (Partial<LLMMessage> & Record<string, unknown>)[], tools?: readonly Tool[] | null): {
|
|
223
|
+
messages: Record<string, unknown>[];
|
|
224
|
+
body: Record<string, unknown>;
|
|
225
|
+
systemMessage: string | null;
|
|
226
|
+
system_message: string | null;
|
|
227
|
+
};
|
|
228
|
+
prepareConverseStreamRequestBody(messages: string | readonly (Partial<LLMMessage> & Record<string, unknown>)[], tools?: readonly Tool[] | null): {
|
|
229
|
+
messages: Record<string, unknown>[];
|
|
230
|
+
body: Record<string, unknown>;
|
|
231
|
+
systemMessage: string | null;
|
|
232
|
+
system_message: string | null;
|
|
233
|
+
};
|
|
234
|
+
_prepare_converse_stream_request_body(messages: string | readonly (Partial<LLMMessage> & Record<string, unknown>)[], tools?: readonly Tool[] | null): {
|
|
235
|
+
messages: Record<string, unknown>[];
|
|
236
|
+
body: Record<string, unknown>;
|
|
237
|
+
systemMessage: string | null;
|
|
238
|
+
system_message: string | null;
|
|
239
|
+
};
|
|
240
|
+
extractBedrockTokenUsage(usage: unknown): Record<string, number>;
|
|
241
|
+
_extract_bedrock_token_usage(usage: unknown): Record<string, number>;
|
|
242
|
+
static extractBedrockTokenUsage(usage: unknown): Record<string, number>;
|
|
243
|
+
static extract_bedrock_token_usage(usage: unknown): Record<string, number>;
|
|
244
|
+
static extractToolUsesFromResponse(response: unknown): Record<string, unknown>[];
|
|
245
|
+
static extract_tool_uses_from_response(response: unknown): Record<string, unknown>[];
|
|
246
|
+
static extractStructuredOutputFromResponse(response: unknown): Record<string, unknown> | null;
|
|
247
|
+
static extract_structured_output_from_response(response: unknown): Record<string, unknown> | null;
|
|
248
|
+
executeToolUseAndPrepareMessages(messages: readonly Record<string, unknown>[], toolUse: unknown, availableFunctions: Record<string, LLMAvailableFunction>): Promise<{
|
|
249
|
+
result: string | null;
|
|
250
|
+
messages: Record<string, unknown>[];
|
|
251
|
+
}>;
|
|
252
|
+
_execute_tool_use_and_prepare_messages(messages: readonly Record<string, unknown>[], toolUse: unknown, availableFunctions: Record<string, LLMAvailableFunction>): Promise<{
|
|
253
|
+
result: string | null;
|
|
254
|
+
messages: Record<string, unknown>[];
|
|
255
|
+
}>;
|
|
256
|
+
accumulateConverseStreamEvents(events: readonly unknown[]): {
|
|
257
|
+
text: string;
|
|
258
|
+
tool_calls: Record<string, unknown>[];
|
|
259
|
+
usage: Record<string, number> | null;
|
|
260
|
+
stop_reason: string | null;
|
|
261
|
+
};
|
|
262
|
+
_accumulate_converse_stream_events(events: readonly unknown[]): {
|
|
263
|
+
text: string;
|
|
264
|
+
tool_calls: Record<string, unknown>[];
|
|
265
|
+
usage: Record<string, number> | null;
|
|
266
|
+
stop_reason: string | null;
|
|
267
|
+
};
|
|
268
|
+
trackTokenUsageInternal(usageData: Record<string, unknown>): void;
|
|
269
|
+
_track_token_usage_internal(usageData: Record<string, unknown>): void;
|
|
270
|
+
private isClaudeModel;
|
|
271
|
+
}
|
|
272
|
+
export type GeminiCompletionOptions = BaseLLMOptions & {
|
|
273
|
+
project?: string | null;
|
|
274
|
+
location?: string | null;
|
|
275
|
+
use_vertexai?: boolean;
|
|
276
|
+
useVertexai?: boolean;
|
|
277
|
+
timeout?: number | null;
|
|
278
|
+
max_retries?: number;
|
|
279
|
+
maxRetries?: number;
|
|
280
|
+
top_p?: number | null;
|
|
281
|
+
topP?: number | null;
|
|
282
|
+
top_k?: number | null;
|
|
283
|
+
topK?: number | null;
|
|
284
|
+
max_output_tokens?: number | null;
|
|
285
|
+
maxOutputTokens?: number | null;
|
|
286
|
+
safety_settings?: readonly unknown[] | null;
|
|
287
|
+
safetySettings?: readonly unknown[] | null;
|
|
288
|
+
thinking_config?: unknown;
|
|
289
|
+
thinkingConfig?: unknown;
|
|
290
|
+
stream?: boolean;
|
|
291
|
+
client_params?: Record<string, unknown> | null;
|
|
292
|
+
clientParams?: Record<string, unknown> | null;
|
|
293
|
+
interceptor?: unknown;
|
|
294
|
+
};
|
|
295
|
+
export declare class GeminiCompletion extends ConfiguredLLM {
|
|
296
|
+
readonly project: string | null;
|
|
297
|
+
readonly location: string;
|
|
298
|
+
readonly useVertexai: boolean;
|
|
299
|
+
readonly use_vertexai: boolean;
|
|
300
|
+
readonly timeout: number | null;
|
|
301
|
+
readonly maxRetries: number;
|
|
302
|
+
readonly max_retries: number;
|
|
303
|
+
readonly topP: number | null;
|
|
304
|
+
readonly top_p: number | null;
|
|
305
|
+
readonly topK: number | null;
|
|
306
|
+
readonly top_k: number | null;
|
|
307
|
+
readonly maxOutputTokens: number | null;
|
|
308
|
+
readonly max_output_tokens: number | null;
|
|
309
|
+
readonly safetySettings: readonly unknown[] | null;
|
|
310
|
+
readonly safety_settings: readonly unknown[] | null;
|
|
311
|
+
readonly thinkingConfig: unknown;
|
|
312
|
+
readonly thinking_config: unknown;
|
|
313
|
+
readonly stream: boolean;
|
|
314
|
+
readonly clientParams: Record<string, unknown> | null;
|
|
315
|
+
readonly client_params: Record<string, unknown> | null;
|
|
316
|
+
readonly interceptor: unknown;
|
|
317
|
+
readonly supportsTools: boolean;
|
|
318
|
+
readonly supports_tools: boolean;
|
|
319
|
+
readonly isGemini20: boolean;
|
|
320
|
+
readonly is_gemini_2_0: boolean;
|
|
321
|
+
_client: Record<string, unknown> | null;
|
|
322
|
+
tools: readonly Tool[] | null;
|
|
323
|
+
constructor(options?: GeminiCompletionOptions);
|
|
324
|
+
call(messages: readonly LLMMessage[], options?: LLMCallOptions): Promise<LLMResponse>;
|
|
325
|
+
acall(messages: LLMMessageInput, options?: LLMCallOptions): Promise<LLMResponse>;
|
|
326
|
+
supportsFunctionCalling(): boolean;
|
|
327
|
+
supports_function_calling(): boolean;
|
|
328
|
+
supportsStopWords(): boolean;
|
|
329
|
+
supports_stop_words(): boolean;
|
|
330
|
+
supportsMultimodal(): boolean;
|
|
331
|
+
supports_multimodal(): boolean;
|
|
332
|
+
getContextWindowSize(): number;
|
|
333
|
+
get_context_window_size(): number;
|
|
334
|
+
formatTextContent(text: string): {
|
|
335
|
+
text: string;
|
|
336
|
+
};
|
|
337
|
+
format_text_content(text: string): {
|
|
338
|
+
text: string;
|
|
339
|
+
};
|
|
340
|
+
getFileUploader(): LocalFileUploader;
|
|
341
|
+
get_file_uploader(): LocalFileUploader;
|
|
342
|
+
getSyncClient(env?: NodeJS.ProcessEnv): Record<string, unknown>;
|
|
343
|
+
_get_sync_client(env?: NodeJS.ProcessEnv): Record<string, unknown>;
|
|
344
|
+
prepareGenerationConfig(systemInstruction?: string | null, tools?: readonly Tool[] | null, responseModel?: unknown): Record<string, unknown>;
|
|
345
|
+
_prepare_generation_config(systemInstruction?: string | null, tools?: readonly Tool[] | null, responseModel?: unknown): Record<string, unknown>;
|
|
346
|
+
convertToolsForInterference(tools: readonly Tool[]): Record<string, unknown>[];
|
|
347
|
+
_convert_tools_for_interference(tools: readonly Tool[]): Record<string, unknown>[];
|
|
348
|
+
formatMessagesForGemini(messages: string | readonly (Partial<LLMMessage> & Record<string, unknown>)[]): [Record<string, unknown>[], string | null];
|
|
349
|
+
_format_messages_for_gemini(messages: string | readonly (Partial<LLMMessage> & Record<string, unknown>)[]): [Record<string, unknown>[], string | null];
|
|
350
|
+
toConfigDict(): Record<string, unknown>;
|
|
351
|
+
to_config_dict(): Record<string, unknown>;
|
|
352
|
+
static extractTokenUsage(response: unknown): Record<string, number>;
|
|
353
|
+
static extract_token_usage(response: unknown): Record<string, number>;
|
|
354
|
+
static _extract_token_usage(response: unknown): Record<string, number>;
|
|
355
|
+
static extractTextFromResponse(response: unknown): string;
|
|
356
|
+
static extract_text_from_response(response: unknown): string;
|
|
357
|
+
static extractFunctionCallsFromResponse(response: unknown): Record<string, unknown>[];
|
|
358
|
+
static extract_function_calls_from_response(response: unknown): Record<string, unknown>[];
|
|
359
|
+
static extractStructuredOutputFromResponse(response: unknown): Record<string, unknown> | null;
|
|
360
|
+
static extract_structured_output_from_response(response: unknown): Record<string, unknown> | null;
|
|
361
|
+
processResponseWithTools(response: unknown, contents?: readonly unknown[], availableFunctions?: Record<string, LLMAvailableFunction> | null, generateContent?: ((contents: readonly unknown[]) => Promise<unknown>) | null, maxToolRounds?: number): Promise<unknown>;
|
|
362
|
+
_process_response_with_tools(response: unknown, contents?: readonly unknown[], availableFunctions?: Record<string, LLMAvailableFunction> | null): Promise<unknown>;
|
|
363
|
+
static addPropertyOrdering<T extends Record<string, unknown>>(schema: T): T;
|
|
364
|
+
static add_property_ordering<T extends Record<string, unknown>>(schema: T): T;
|
|
365
|
+
static convertContentsToDict(contents: readonly unknown[]): LLMMessage[];
|
|
366
|
+
static convert_contents_to_dict(contents: readonly unknown[]): LLMMessage[];
|
|
367
|
+
accumulateStreamChunks(chunks: readonly unknown[]): {
|
|
368
|
+
text: string;
|
|
369
|
+
function_calls: Record<string, unknown>[];
|
|
370
|
+
usage: Record<string, number> | null;
|
|
371
|
+
thinking_text: string;
|
|
372
|
+
response_id: string | null;
|
|
373
|
+
};
|
|
374
|
+
_accumulate_stream_chunks(chunks: readonly unknown[]): {
|
|
375
|
+
text: string;
|
|
376
|
+
function_calls: Record<string, unknown>[];
|
|
377
|
+
usage: Record<string, number> | null;
|
|
378
|
+
thinking_text: string;
|
|
379
|
+
response_id: string | null;
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
export type SnowflakeCompletionOptions = OpenAICompletionOptions & {
|
|
383
|
+
account_url?: string | null;
|
|
384
|
+
accountUrl?: string | null;
|
|
385
|
+
account_identifier?: string | null;
|
|
386
|
+
accountIdentifier?: string | null;
|
|
387
|
+
account?: string | null;
|
|
388
|
+
snowflake_account?: string | null;
|
|
389
|
+
snowflakeAccount?: string | null;
|
|
390
|
+
database?: string | null;
|
|
391
|
+
schema_name?: string | null;
|
|
392
|
+
schemaName?: string | null;
|
|
393
|
+
warehouse?: string | null;
|
|
394
|
+
role?: string | null;
|
|
395
|
+
};
|
|
396
|
+
export declare class SnowflakeCompletion extends OpenAICompletion {
|
|
397
|
+
readonly accountUrl: string;
|
|
398
|
+
readonly account_url: string;
|
|
399
|
+
readonly accountIdentifier: string | null;
|
|
400
|
+
readonly account_identifier: string | null;
|
|
401
|
+
readonly database: string | null;
|
|
402
|
+
readonly schemaName: string | null;
|
|
403
|
+
readonly schema_name: string | null;
|
|
404
|
+
readonly warehouse: string | null;
|
|
405
|
+
readonly role: string | null;
|
|
406
|
+
constructor(options?: SnowflakeCompletionOptions);
|
|
407
|
+
static normalizeSnowflakeBaseUrl(value: string): string;
|
|
408
|
+
static _normalize_snowflake_base_url(value: string): string;
|
|
409
|
+
static baseUrlFromAccountIdentifier(accountIdentifier: string): string;
|
|
410
|
+
static _base_url_from_account_identifier(accountIdentifier: string): string;
|
|
411
|
+
static resolveToken(apiKey: string | null | undefined): string;
|
|
412
|
+
static _resolve_token(apiKey: string | null | undefined): string;
|
|
413
|
+
static resolveBaseUrl(data: SnowflakeCompletionOptions): string;
|
|
414
|
+
static _resolve_base_url(data: SnowflakeCompletionOptions): string;
|
|
415
|
+
formatMessages(messages: LLMMessageInput): LLMMessage[];
|
|
416
|
+
_format_messages(messages: LLMMessageInput): LLMMessage[];
|
|
417
|
+
static hasProviderContentBlocks(messages: LLMMessageInput): boolean;
|
|
418
|
+
static formatProviderContentBlockMessages(messages: LLMMessageInput): LLMMessage[];
|
|
419
|
+
isClaudeModel(): boolean;
|
|
420
|
+
_is_claude_model(): boolean;
|
|
421
|
+
static normalizeStringifiedToolCalls(messages: readonly LLMMessage[]): LLMMessage[];
|
|
422
|
+
static _normalize_stringified_tool_calls(messages: readonly LLMMessage[]): LLMMessage[];
|
|
423
|
+
static removeIncompleteClaudeToolUses(messages: readonly LLMMessage[]): LLMMessage[];
|
|
424
|
+
static _remove_incomplete_claude_tool_uses(messages: readonly LLMMessage[]): LLMMessage[];
|
|
425
|
+
static summarizeToolResults(messages: readonly LLMMessage[], expectedIds: Set<string>): string;
|
|
426
|
+
static _summarize_tool_results(messages: readonly LLMMessage[], expectedIds: Set<string>): string;
|
|
427
|
+
static extractToolResultText(content: readonly unknown[], expectedIds?: Set<string> | null): string;
|
|
428
|
+
static _extract_tool_result_text(content: readonly unknown[]): string;
|
|
429
|
+
static extractClaudeToolUseIds(message: LLMMessage & Record<string, unknown>): Set<string>;
|
|
430
|
+
static _extract_claude_tool_use_ids(message: LLMMessage & Record<string, unknown>): Set<string>;
|
|
431
|
+
static extractClaudeToolResultIds(message: LLMMessage & Record<string, unknown>): Set<string>;
|
|
432
|
+
static _extract_claude_tool_result_ids(message: LLMMessage & Record<string, unknown>): Set<string>;
|
|
433
|
+
static isToolResultMessage(message: LLMMessage & Record<string, unknown>): boolean;
|
|
434
|
+
static _is_tool_result_message(message: LLMMessage & Record<string, unknown>): boolean;
|
|
435
|
+
static ensureClaudeConversationEndsWithUser(messages: readonly LLMMessage[]): LLMMessage[];
|
|
436
|
+
static _ensure_claude_conversation_ends_with_user(messages: readonly LLMMessage[]): LLMMessage[];
|
|
437
|
+
prepareCompletionParams(messages: readonly LLMMessage[], tools?: readonly Tool[] | null): Record<string, unknown>;
|
|
438
|
+
_prepare_completion_params(messages: readonly LLMMessage[], tools?: readonly Tool[] | null): Record<string, unknown>;
|
|
439
|
+
getSyncClient(env?: NodeJS.ProcessEnv): Record<string, unknown>;
|
|
440
|
+
_get_sync_client(env?: NodeJS.ProcessEnv): Record<string, unknown>;
|
|
441
|
+
call(messages: readonly LLMMessage[], options?: LLMCallOptions): Promise<LLMResponse>;
|
|
442
|
+
supportsFunctionCalling(): boolean;
|
|
443
|
+
supports_function_calling(): boolean;
|
|
444
|
+
supportsMultimodal(): boolean;
|
|
445
|
+
supports_multimodal(): boolean;
|
|
446
|
+
toConfigDict(): Record<string, unknown>;
|
|
447
|
+
to_config_dict(): Record<string, unknown>;
|
|
448
|
+
}
|
|
449
|
+
export declare const AzureCompletionParams: Readonly<{
|
|
450
|
+
kind: "AzureCompletionParams";
|
|
451
|
+
}>;
|
|
452
|
+
export type AzureCompletionParams = {
|
|
453
|
+
messages?: readonly LLMMessage[];
|
|
454
|
+
stream?: boolean;
|
|
455
|
+
model_extras?: Record<string, unknown>;
|
|
456
|
+
response_format?: unknown;
|
|
457
|
+
model?: string;
|
|
458
|
+
temperature?: number;
|
|
459
|
+
top_p?: number;
|
|
460
|
+
frequency_penalty?: number;
|
|
461
|
+
presence_penalty?: number;
|
|
462
|
+
max_tokens?: number;
|
|
463
|
+
stop?: readonly string[];
|
|
464
|
+
tools?: readonly unknown[];
|
|
465
|
+
tool_choice?: string;
|
|
466
|
+
};
|
|
467
|
+
export type AzureCompletionOptions = BaseLLMOptions & {
|
|
468
|
+
endpoint?: string | null;
|
|
469
|
+
api_version?: string | null;
|
|
470
|
+
apiVersion?: string | null;
|
|
471
|
+
timeout?: number | null;
|
|
472
|
+
max_retries?: number;
|
|
473
|
+
maxRetries?: number;
|
|
474
|
+
top_p?: number | null;
|
|
475
|
+
topP?: number | null;
|
|
476
|
+
frequency_penalty?: number | null;
|
|
477
|
+
frequencyPenalty?: number | null;
|
|
478
|
+
presence_penalty?: number | null;
|
|
479
|
+
presencePenalty?: number | null;
|
|
480
|
+
max_tokens?: number | null;
|
|
481
|
+
maxTokens?: number | null;
|
|
482
|
+
stream?: boolean;
|
|
483
|
+
interceptor?: unknown;
|
|
484
|
+
response_format?: unknown;
|
|
485
|
+
responseFormat?: unknown;
|
|
486
|
+
credential_scopes?: readonly string[] | null;
|
|
487
|
+
credentialScopes?: readonly string[] | null;
|
|
488
|
+
api?: "completions" | "responses";
|
|
489
|
+
reasoning_effort?: string | null;
|
|
490
|
+
reasoningEffort?: string | null;
|
|
491
|
+
instructions?: string | null;
|
|
492
|
+
store?: boolean | null;
|
|
493
|
+
previous_response_id?: string | null;
|
|
494
|
+
previousResponseId?: string | null;
|
|
495
|
+
include?: readonly string[] | null;
|
|
496
|
+
builtin_tools?: readonly string[] | null;
|
|
497
|
+
builtinTools?: readonly string[] | null;
|
|
498
|
+
parse_tool_outputs?: boolean;
|
|
499
|
+
parseToolOutputs?: boolean;
|
|
500
|
+
auto_chain?: boolean;
|
|
501
|
+
autoChain?: boolean;
|
|
502
|
+
auto_chain_reasoning?: boolean;
|
|
503
|
+
autoChainReasoning?: boolean;
|
|
504
|
+
max_completion_tokens?: number | null;
|
|
505
|
+
maxCompletionTokens?: number | null;
|
|
506
|
+
};
|
|
507
|
+
export declare class AzureCompletion extends ConfiguredLLM {
|
|
508
|
+
readonly endpoint: string | null;
|
|
509
|
+
readonly apiVersion: string | null;
|
|
510
|
+
readonly api_version: string | null;
|
|
511
|
+
readonly timeout: number | null;
|
|
512
|
+
readonly maxRetries: number;
|
|
513
|
+
readonly max_retries: number;
|
|
514
|
+
readonly topP: number | null;
|
|
515
|
+
readonly top_p: number | null;
|
|
516
|
+
readonly frequencyPenalty: number | null;
|
|
517
|
+
readonly frequency_penalty: number | null;
|
|
518
|
+
readonly presencePenalty: number | null;
|
|
519
|
+
readonly presence_penalty: number | null;
|
|
520
|
+
readonly maxTokens: number | null;
|
|
521
|
+
readonly max_tokens: number | null;
|
|
522
|
+
readonly stream: boolean;
|
|
523
|
+
readonly interceptor: unknown;
|
|
524
|
+
readonly responseFormat: ConfiguredLLM["responseFormat"];
|
|
525
|
+
readonly response_format: ConfiguredLLM["response_format"];
|
|
526
|
+
readonly isOpenAIModel: boolean;
|
|
527
|
+
readonly is_openai_model: boolean;
|
|
528
|
+
readonly isAzureOpenAIEndpoint: boolean;
|
|
529
|
+
readonly is_azure_openai_endpoint: boolean;
|
|
530
|
+
readonly credentialScopes: readonly string[] | null;
|
|
531
|
+
readonly credential_scopes: readonly string[] | null;
|
|
532
|
+
readonly api: "completions" | "responses";
|
|
533
|
+
readonly reasoningEffort: string | null;
|
|
534
|
+
readonly reasoning_effort: string | null;
|
|
535
|
+
readonly instructions: string | null;
|
|
536
|
+
readonly store: boolean | null;
|
|
537
|
+
readonly previousResponseId: string | null;
|
|
538
|
+
readonly previous_response_id: string | null;
|
|
539
|
+
readonly include: readonly string[] | null;
|
|
540
|
+
readonly builtinTools: readonly string[] | null;
|
|
541
|
+
readonly builtin_tools: readonly string[] | null;
|
|
542
|
+
readonly parseToolOutputs: boolean;
|
|
543
|
+
readonly parse_tool_outputs: boolean;
|
|
544
|
+
readonly autoChain: boolean;
|
|
545
|
+
readonly auto_chain: boolean;
|
|
546
|
+
readonly autoChainReasoning: boolean;
|
|
547
|
+
readonly auto_chain_reasoning: boolean;
|
|
548
|
+
readonly maxCompletionTokens: number | null;
|
|
549
|
+
readonly max_completion_tokens: number | null;
|
|
550
|
+
readonly _responses_delegate: OpenAICompletion | null;
|
|
551
|
+
_client: Record<string, unknown> | null;
|
|
552
|
+
private responseChainId;
|
|
553
|
+
private reasoningChainItems;
|
|
554
|
+
constructor(options?: AzureCompletionOptions);
|
|
555
|
+
call(messages: readonly LLMMessage[], options?: LLMCallOptions): Promise<LLMResponse>;
|
|
556
|
+
acall(messages: LLMMessageInput, options?: LLMCallOptions): Promise<LLMResponse>;
|
|
557
|
+
aclose(): Promise<void>;
|
|
558
|
+
supportsFunctionCalling(): boolean;
|
|
559
|
+
supports_function_calling(): boolean;
|
|
560
|
+
supportsStopWords(): boolean;
|
|
561
|
+
supports_stop_words(): boolean;
|
|
562
|
+
supportsMultimodal(): boolean;
|
|
563
|
+
supports_multimodal(): boolean;
|
|
564
|
+
getContextWindowSize(): number;
|
|
565
|
+
get_context_window_size(): number;
|
|
566
|
+
get lastResponseId(): string | null;
|
|
567
|
+
get last_response_id(): string | null;
|
|
568
|
+
get lastReasoningItems(): readonly unknown[] | null;
|
|
569
|
+
get last_reasoning_items(): readonly unknown[] | null;
|
|
570
|
+
resetChain(): void;
|
|
571
|
+
reset_chain(): void;
|
|
572
|
+
resetReasoningChain(): void;
|
|
573
|
+
reset_reasoning_chain(): void;
|
|
574
|
+
toConfigDict(): Record<string, unknown>;
|
|
575
|
+
to_config_dict(): Record<string, unknown>;
|
|
576
|
+
makeClientKwargs(env?: NodeJS.ProcessEnv): Record<string, unknown>;
|
|
577
|
+
_make_client_kwargs(env?: NodeJS.ProcessEnv): Record<string, unknown>;
|
|
578
|
+
getSyncClient(env?: NodeJS.ProcessEnv): Record<string, unknown>;
|
|
579
|
+
_get_sync_client(env?: NodeJS.ProcessEnv): Record<string, unknown>;
|
|
580
|
+
prepareCompletionParams(messages: readonly LLMMessage[], tools?: readonly Tool[] | null): AzureCompletionParams;
|
|
581
|
+
_prepare_completion_params(messages: readonly LLMMessage[], tools?: readonly Tool[] | null): AzureCompletionParams;
|
|
582
|
+
prepareResponsesParams(messages: readonly LLMMessage[], tools?: readonly Tool[] | null, responseModel?: unknown): Record<string, unknown>;
|
|
583
|
+
_prepare_responses_params(messages: readonly LLMMessage[], tools?: readonly Tool[] | null, responseModel?: unknown): Record<string, unknown>;
|
|
584
|
+
convertToolsForInterference(tools: readonly Tool[]): Record<string, unknown>[];
|
|
585
|
+
_convert_tools_for_interference(tools: readonly Tool[]): Record<string, unknown>[];
|
|
586
|
+
static credentialScopesFromEnv(env?: NodeJS.ProcessEnv): string[] | null;
|
|
587
|
+
static _credential_scopes_from_env(): string[] | null;
|
|
588
|
+
extractAzureTokenUsage(response: unknown): Record<string, number>;
|
|
589
|
+
_extract_azure_token_usage(response: unknown): Record<string, number>;
|
|
590
|
+
static extractAzureTokenUsage(response: unknown): Record<string, number>;
|
|
591
|
+
static extract_azure_token_usage(response: unknown): Record<string, number>;
|
|
592
|
+
getFileUploader(): LocalFileUploader;
|
|
593
|
+
}
|