@blockrun/llm 1.4.2 → 1.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 +9 -1
- package/dist/index.cjs +445 -36662
- package/dist/index.d.cts +110 -11
- package/dist/index.d.ts +110 -11
- package/dist/index.js +330 -32
- package/package.json +4 -4
- package/dist/chunk-KRDGCX7W.js +0 -27187
- package/dist/esm-PTFDM6PE.js +0 -8117
- package/dist/index.esm-SXKIFLA7.js +0 -158
package/dist/index.d.cts
CHANGED
|
@@ -64,6 +64,7 @@ interface Model {
|
|
|
64
64
|
outputPrice: number;
|
|
65
65
|
contextWindow: number;
|
|
66
66
|
maxOutput: number;
|
|
67
|
+
categories: string[];
|
|
67
68
|
available: boolean;
|
|
68
69
|
type?: "llm" | "image";
|
|
69
70
|
}
|
|
@@ -139,10 +140,48 @@ interface SearchParameters {
|
|
|
139
140
|
toDate?: string;
|
|
140
141
|
maxSearchResults?: number;
|
|
141
142
|
}
|
|
143
|
+
/** Usage info for Live Search sources */
|
|
144
|
+
interface SearchUsage {
|
|
145
|
+
/** Number of search sources used in the response */
|
|
146
|
+
numSourcesUsed?: number;
|
|
147
|
+
}
|
|
142
148
|
interface Spending {
|
|
143
149
|
totalUsd: number;
|
|
144
150
|
calls: number;
|
|
145
151
|
}
|
|
152
|
+
/** Pre-request cost estimate for a chat call */
|
|
153
|
+
interface CostEstimate {
|
|
154
|
+
/** Model ID used for the estimate */
|
|
155
|
+
model: string;
|
|
156
|
+
/** Estimated input token count */
|
|
157
|
+
estimatedInputTokens: number;
|
|
158
|
+
/** Estimated output token count */
|
|
159
|
+
estimatedOutputTokens: number;
|
|
160
|
+
/** Estimated cost in USD */
|
|
161
|
+
estimatedCostUsd: number;
|
|
162
|
+
}
|
|
163
|
+
/** Per-call spending report with running session totals */
|
|
164
|
+
interface SpendingReport {
|
|
165
|
+
/** Model ID used */
|
|
166
|
+
model: string;
|
|
167
|
+
/** Input tokens consumed */
|
|
168
|
+
inputTokens: number;
|
|
169
|
+
/** Output tokens consumed */
|
|
170
|
+
outputTokens: number;
|
|
171
|
+
/** Cost of this call in USD */
|
|
172
|
+
costUsd: number;
|
|
173
|
+
/** Cumulative session spend in USD */
|
|
174
|
+
sessionTotalUsd: number;
|
|
175
|
+
/** Total number of calls in this session */
|
|
176
|
+
sessionCalls: number;
|
|
177
|
+
}
|
|
178
|
+
/** Chat response bundled with its spending report */
|
|
179
|
+
interface ChatResponseWithCost {
|
|
180
|
+
/** The chat completion response */
|
|
181
|
+
response: ChatResponse;
|
|
182
|
+
/** Spending report for this call */
|
|
183
|
+
spendingReport: SpendingReport;
|
|
184
|
+
}
|
|
146
185
|
interface ResourceInfo {
|
|
147
186
|
url: string;
|
|
148
187
|
description?: string;
|
|
@@ -183,9 +222,9 @@ interface ChatOptions {
|
|
|
183
222
|
temperature?: number;
|
|
184
223
|
/** Nucleus sampling parameter */
|
|
185
224
|
topP?: number;
|
|
186
|
-
/** Enable
|
|
225
|
+
/** Enable Live Search (shortcut for searchParameters.mode = "on") */
|
|
187
226
|
search?: boolean;
|
|
188
|
-
/** Full
|
|
227
|
+
/** Full Live Search configuration (for search-enabled models) */
|
|
189
228
|
searchParameters?: SearchParameters;
|
|
190
229
|
}
|
|
191
230
|
interface ChatCompletionOptions {
|
|
@@ -195,9 +234,9 @@ interface ChatCompletionOptions {
|
|
|
195
234
|
temperature?: number;
|
|
196
235
|
/** Nucleus sampling parameter */
|
|
197
236
|
topP?: number;
|
|
198
|
-
/** Enable
|
|
237
|
+
/** Enable Live Search (shortcut for searchParameters.mode = "on") */
|
|
199
238
|
search?: boolean;
|
|
200
|
-
/** Full
|
|
239
|
+
/** Full Live Search configuration (for search-enabled models) */
|
|
201
240
|
searchParameters?: SearchParameters;
|
|
202
241
|
/** Tool definitions for function calling */
|
|
203
242
|
tools?: Tool[];
|
|
@@ -405,7 +444,7 @@ declare class APIError extends BlockrunError {
|
|
|
405
444
|
* // Option 2: Pass private key directly
|
|
406
445
|
* const client = new LLMClient({ privateKey: '0x...' });
|
|
407
446
|
*
|
|
408
|
-
* const response = await client.chat('openai/gpt-
|
|
447
|
+
* const response = await client.chat('openai/gpt-5.2', 'Hello!');
|
|
409
448
|
* console.log(response);
|
|
410
449
|
*/
|
|
411
450
|
|
|
@@ -453,13 +492,13 @@ declare class LLMClient {
|
|
|
453
492
|
/**
|
|
454
493
|
* Simple 1-line chat interface.
|
|
455
494
|
*
|
|
456
|
-
* @param model - Model ID (e.g., 'openai/gpt-
|
|
495
|
+
* @param model - Model ID (e.g., 'openai/gpt-5.2', 'anthropic/claude-sonnet-4.6')
|
|
457
496
|
* @param prompt - User message
|
|
458
497
|
* @param options - Optional chat parameters
|
|
459
498
|
* @returns Assistant's response text
|
|
460
499
|
*
|
|
461
500
|
* @example
|
|
462
|
-
* const response = await client.chat('gpt-
|
|
501
|
+
* const response = await client.chat('gpt-5.2', 'What is the capital of France?');
|
|
463
502
|
* console.log(response); // 'The capital of France is Paris.'
|
|
464
503
|
*/
|
|
465
504
|
chat(model: string, prompt: string, options?: ChatOptions): Promise<string>;
|
|
@@ -1107,7 +1146,7 @@ declare const WALLET_DIR_PATH: string;
|
|
|
1107
1146
|
* // Or pass key directly
|
|
1108
1147
|
* const client = new SolanaLLMClient({ privateKey: 'your-bs58-key' });
|
|
1109
1148
|
*
|
|
1110
|
-
* const response = await client.chat('openai/gpt-
|
|
1149
|
+
* const response = await client.chat('openai/gpt-5.2', 'gm Solana');
|
|
1111
1150
|
*/
|
|
1112
1151
|
|
|
1113
1152
|
interface SolanaLLMClientOptions {
|
|
@@ -1227,6 +1266,11 @@ declare function getCachedByRequest(endpoint: string, body: Record<string, unkno
|
|
|
1227
1266
|
declare function setCache(key: string, data: unknown, ttlMs: number): void;
|
|
1228
1267
|
declare function saveToCache(endpoint: string, body: Record<string, unknown>, response: unknown, costUsd?: number): void;
|
|
1229
1268
|
declare function clearCache(): number;
|
|
1269
|
+
declare function getCostLogSummary(): {
|
|
1270
|
+
totalUsd: number;
|
|
1271
|
+
calls: number;
|
|
1272
|
+
byEndpoint: Record<string, number>;
|
|
1273
|
+
};
|
|
1230
1274
|
|
|
1231
1275
|
/**
|
|
1232
1276
|
* Agent wallet setup utilities.
|
|
@@ -1276,7 +1320,7 @@ declare function getCostSummary(): {
|
|
|
1276
1320
|
*
|
|
1277
1321
|
* // Rest of your code stays exactly the same!
|
|
1278
1322
|
* const response = await client.chat.completions.create({
|
|
1279
|
-
* model: 'gpt-
|
|
1323
|
+
* model: 'gpt-5.2',
|
|
1280
1324
|
* messages: [{ role: 'user', content: 'Hello!' }]
|
|
1281
1325
|
* });
|
|
1282
1326
|
*/
|
|
@@ -1383,7 +1427,7 @@ declare class Chat {
|
|
|
1383
1427
|
* const client = new OpenAI({ walletKey: '0x...' });
|
|
1384
1428
|
*
|
|
1385
1429
|
* const response = await client.chat.completions.create({
|
|
1386
|
-
* model: 'gpt-
|
|
1430
|
+
* model: 'gpt-5.2',
|
|
1387
1431
|
* messages: [{ role: 'user', content: 'Hello!' }]
|
|
1388
1432
|
* });
|
|
1389
1433
|
*
|
|
@@ -1418,4 +1462,59 @@ declare class AnthropicClient {
|
|
|
1418
1462
|
getWalletAddress(): string;
|
|
1419
1463
|
}
|
|
1420
1464
|
|
|
1421
|
-
|
|
1465
|
+
/**
|
|
1466
|
+
* Input validation and security utilities for BlockRun LLM SDK.
|
|
1467
|
+
*
|
|
1468
|
+
* This module provides validation functions to ensure:
|
|
1469
|
+
* - Private keys are properly formatted
|
|
1470
|
+
* - API URLs use HTTPS
|
|
1471
|
+
* - Server responses don't leak sensitive information
|
|
1472
|
+
* - Resource URLs match expected domains
|
|
1473
|
+
*/
|
|
1474
|
+
|
|
1475
|
+
/**
|
|
1476
|
+
* Known LLM providers (for optional validation).
|
|
1477
|
+
*/
|
|
1478
|
+
declare const KNOWN_PROVIDERS: Set<string>;
|
|
1479
|
+
/**
|
|
1480
|
+
* Validates that a model ID is a non-empty string.
|
|
1481
|
+
*
|
|
1482
|
+
* @param model - The model ID (e.g., "openai/gpt-5.2", "anthropic/claude-sonnet-4.5")
|
|
1483
|
+
* @throws {Error} If the model is invalid
|
|
1484
|
+
*
|
|
1485
|
+
* @example
|
|
1486
|
+
* validateModel("openai/gpt-5.2");
|
|
1487
|
+
*/
|
|
1488
|
+
declare function validateModel(model: string): void;
|
|
1489
|
+
/**
|
|
1490
|
+
* Validates that max_tokens is an integer between 1 and 100,000.
|
|
1491
|
+
*
|
|
1492
|
+
* @param maxTokens - Maximum number of tokens to generate
|
|
1493
|
+
* @throws {Error} If maxTokens is invalid
|
|
1494
|
+
*
|
|
1495
|
+
* @example
|
|
1496
|
+
* validateMaxTokens(1000);
|
|
1497
|
+
*/
|
|
1498
|
+
declare function validateMaxTokens(maxTokens?: number): void;
|
|
1499
|
+
/**
|
|
1500
|
+
* Validates that temperature is a number between 0 and 2.
|
|
1501
|
+
*
|
|
1502
|
+
* @param temperature - Sampling temperature (0-2)
|
|
1503
|
+
* @throws {Error} If temperature is invalid
|
|
1504
|
+
*
|
|
1505
|
+
* @example
|
|
1506
|
+
* validateTemperature(0.7);
|
|
1507
|
+
*/
|
|
1508
|
+
declare function validateTemperature(temperature?: number): void;
|
|
1509
|
+
/**
|
|
1510
|
+
* Validates that top_p is a number between 0 and 1.
|
|
1511
|
+
*
|
|
1512
|
+
* @param topP - Top-p sampling parameter (0-1)
|
|
1513
|
+
* @throws {Error} If topP is invalid
|
|
1514
|
+
*
|
|
1515
|
+
* @example
|
|
1516
|
+
* validateTopP(0.9);
|
|
1517
|
+
*/
|
|
1518
|
+
declare function validateTopP(topP?: number): void;
|
|
1519
|
+
|
|
1520
|
+
export { APIError, AnthropicClient, BASE_CHAIN_ID, type BlockRunAnthropicOptions, BlockrunError, type ChatChoice, type ChatCompletionOptions, type ChatMessage, type ChatOptions, type ChatResponse, type ChatResponseWithCost, type ChatUsage, type CostEntry, type CostEstimate, type CreatePaymentOptions, type FunctionCall, type FunctionDefinition, ImageClient, type ImageClientOptions, type ImageData, type ImageEditOptions, type ImageGenerateOptions, type ImageModel, type ImageResponse, KNOWN_PROVIDERS, LLMClient, type LLMClientOptions, type Model, type NewsSearchSource, OpenAI, type OpenAIChatCompletionChoice, type OpenAIChatCompletionChunk, type OpenAIChatCompletionParams, type OpenAIChatCompletionResponse, type OpenAIClientOptions, PaymentError, type PaymentLinks, type RoutingDecision, type RoutingProfile, type RoutingTier, type RssSearchSource, SOLANA_NETWORK, SOLANA_WALLET_FILE as SOLANA_WALLET_FILE_PATH, type SearchOptions, type SearchParameters, type SearchResult, type SearchSource, type SearchUsage, type SmartChatOptions, type SmartChatResponse, SolanaLLMClient, type SolanaLLMClientOptions, type SolanaWalletInfo, type Spending, type SpendingReport, type Tool, type ToolCall, type ToolChoice, USDC_BASE, USDC_BASE_CONTRACT, USDC_SOLANA, WALLET_DIR_PATH, WALLET_FILE_PATH, type WalletInfo, type WebSearchSource, type XArticlesRisingResponse, type XAuthorAnalyticsResponse, type XCompareAuthorsResponse, type XFollower, type XFollowersResponse, type XFollowingsResponse, type XMentionsResponse, type XSearchResponse, type XSearchSource, type XTrendingResponse, type XTweet, type XTweetLookupResponse, type XTweetRepliesResponse, type XTweetThreadResponse, type XTweetsResponse, type XUser, type XUserInfoResponse, type XUserLookupResponse, type XVerifiedFollowersResponse, clearCache, createPaymentPayload, createSolanaPaymentPayload, createSolanaWallet, createWallet, LLMClient as default, extractPaymentDetails, formatFundingMessageCompact, formatNeedsFundingMessage, formatWalletCreatedMessage, getCached, getCachedByRequest, getCostLogSummary, getCostSummary, getEip681Uri, getOrCreateSolanaWallet, getOrCreateWallet, getPaymentLinks, getWalletAddress, loadSolanaWallet, loadWallet, logCost, parsePaymentRequired, saveSolanaWallet, saveToCache, saveWallet, scanSolanaWallets, scanWallets, setCache, setupAgentSolanaWallet, setupAgentWallet, solanaClient, solanaKeyToBytes, solanaPublicKey, status, testnetClient, validateMaxTokens, validateModel, validateTemperature, validateTopP };
|
package/dist/index.d.ts
CHANGED
|
@@ -64,6 +64,7 @@ interface Model {
|
|
|
64
64
|
outputPrice: number;
|
|
65
65
|
contextWindow: number;
|
|
66
66
|
maxOutput: number;
|
|
67
|
+
categories: string[];
|
|
67
68
|
available: boolean;
|
|
68
69
|
type?: "llm" | "image";
|
|
69
70
|
}
|
|
@@ -139,10 +140,48 @@ interface SearchParameters {
|
|
|
139
140
|
toDate?: string;
|
|
140
141
|
maxSearchResults?: number;
|
|
141
142
|
}
|
|
143
|
+
/** Usage info for Live Search sources */
|
|
144
|
+
interface SearchUsage {
|
|
145
|
+
/** Number of search sources used in the response */
|
|
146
|
+
numSourcesUsed?: number;
|
|
147
|
+
}
|
|
142
148
|
interface Spending {
|
|
143
149
|
totalUsd: number;
|
|
144
150
|
calls: number;
|
|
145
151
|
}
|
|
152
|
+
/** Pre-request cost estimate for a chat call */
|
|
153
|
+
interface CostEstimate {
|
|
154
|
+
/** Model ID used for the estimate */
|
|
155
|
+
model: string;
|
|
156
|
+
/** Estimated input token count */
|
|
157
|
+
estimatedInputTokens: number;
|
|
158
|
+
/** Estimated output token count */
|
|
159
|
+
estimatedOutputTokens: number;
|
|
160
|
+
/** Estimated cost in USD */
|
|
161
|
+
estimatedCostUsd: number;
|
|
162
|
+
}
|
|
163
|
+
/** Per-call spending report with running session totals */
|
|
164
|
+
interface SpendingReport {
|
|
165
|
+
/** Model ID used */
|
|
166
|
+
model: string;
|
|
167
|
+
/** Input tokens consumed */
|
|
168
|
+
inputTokens: number;
|
|
169
|
+
/** Output tokens consumed */
|
|
170
|
+
outputTokens: number;
|
|
171
|
+
/** Cost of this call in USD */
|
|
172
|
+
costUsd: number;
|
|
173
|
+
/** Cumulative session spend in USD */
|
|
174
|
+
sessionTotalUsd: number;
|
|
175
|
+
/** Total number of calls in this session */
|
|
176
|
+
sessionCalls: number;
|
|
177
|
+
}
|
|
178
|
+
/** Chat response bundled with its spending report */
|
|
179
|
+
interface ChatResponseWithCost {
|
|
180
|
+
/** The chat completion response */
|
|
181
|
+
response: ChatResponse;
|
|
182
|
+
/** Spending report for this call */
|
|
183
|
+
spendingReport: SpendingReport;
|
|
184
|
+
}
|
|
146
185
|
interface ResourceInfo {
|
|
147
186
|
url: string;
|
|
148
187
|
description?: string;
|
|
@@ -183,9 +222,9 @@ interface ChatOptions {
|
|
|
183
222
|
temperature?: number;
|
|
184
223
|
/** Nucleus sampling parameter */
|
|
185
224
|
topP?: number;
|
|
186
|
-
/** Enable
|
|
225
|
+
/** Enable Live Search (shortcut for searchParameters.mode = "on") */
|
|
187
226
|
search?: boolean;
|
|
188
|
-
/** Full
|
|
227
|
+
/** Full Live Search configuration (for search-enabled models) */
|
|
189
228
|
searchParameters?: SearchParameters;
|
|
190
229
|
}
|
|
191
230
|
interface ChatCompletionOptions {
|
|
@@ -195,9 +234,9 @@ interface ChatCompletionOptions {
|
|
|
195
234
|
temperature?: number;
|
|
196
235
|
/** Nucleus sampling parameter */
|
|
197
236
|
topP?: number;
|
|
198
|
-
/** Enable
|
|
237
|
+
/** Enable Live Search (shortcut for searchParameters.mode = "on") */
|
|
199
238
|
search?: boolean;
|
|
200
|
-
/** Full
|
|
239
|
+
/** Full Live Search configuration (for search-enabled models) */
|
|
201
240
|
searchParameters?: SearchParameters;
|
|
202
241
|
/** Tool definitions for function calling */
|
|
203
242
|
tools?: Tool[];
|
|
@@ -405,7 +444,7 @@ declare class APIError extends BlockrunError {
|
|
|
405
444
|
* // Option 2: Pass private key directly
|
|
406
445
|
* const client = new LLMClient({ privateKey: '0x...' });
|
|
407
446
|
*
|
|
408
|
-
* const response = await client.chat('openai/gpt-
|
|
447
|
+
* const response = await client.chat('openai/gpt-5.2', 'Hello!');
|
|
409
448
|
* console.log(response);
|
|
410
449
|
*/
|
|
411
450
|
|
|
@@ -453,13 +492,13 @@ declare class LLMClient {
|
|
|
453
492
|
/**
|
|
454
493
|
* Simple 1-line chat interface.
|
|
455
494
|
*
|
|
456
|
-
* @param model - Model ID (e.g., 'openai/gpt-
|
|
495
|
+
* @param model - Model ID (e.g., 'openai/gpt-5.2', 'anthropic/claude-sonnet-4.6')
|
|
457
496
|
* @param prompt - User message
|
|
458
497
|
* @param options - Optional chat parameters
|
|
459
498
|
* @returns Assistant's response text
|
|
460
499
|
*
|
|
461
500
|
* @example
|
|
462
|
-
* const response = await client.chat('gpt-
|
|
501
|
+
* const response = await client.chat('gpt-5.2', 'What is the capital of France?');
|
|
463
502
|
* console.log(response); // 'The capital of France is Paris.'
|
|
464
503
|
*/
|
|
465
504
|
chat(model: string, prompt: string, options?: ChatOptions): Promise<string>;
|
|
@@ -1107,7 +1146,7 @@ declare const WALLET_DIR_PATH: string;
|
|
|
1107
1146
|
* // Or pass key directly
|
|
1108
1147
|
* const client = new SolanaLLMClient({ privateKey: 'your-bs58-key' });
|
|
1109
1148
|
*
|
|
1110
|
-
* const response = await client.chat('openai/gpt-
|
|
1149
|
+
* const response = await client.chat('openai/gpt-5.2', 'gm Solana');
|
|
1111
1150
|
*/
|
|
1112
1151
|
|
|
1113
1152
|
interface SolanaLLMClientOptions {
|
|
@@ -1227,6 +1266,11 @@ declare function getCachedByRequest(endpoint: string, body: Record<string, unkno
|
|
|
1227
1266
|
declare function setCache(key: string, data: unknown, ttlMs: number): void;
|
|
1228
1267
|
declare function saveToCache(endpoint: string, body: Record<string, unknown>, response: unknown, costUsd?: number): void;
|
|
1229
1268
|
declare function clearCache(): number;
|
|
1269
|
+
declare function getCostLogSummary(): {
|
|
1270
|
+
totalUsd: number;
|
|
1271
|
+
calls: number;
|
|
1272
|
+
byEndpoint: Record<string, number>;
|
|
1273
|
+
};
|
|
1230
1274
|
|
|
1231
1275
|
/**
|
|
1232
1276
|
* Agent wallet setup utilities.
|
|
@@ -1276,7 +1320,7 @@ declare function getCostSummary(): {
|
|
|
1276
1320
|
*
|
|
1277
1321
|
* // Rest of your code stays exactly the same!
|
|
1278
1322
|
* const response = await client.chat.completions.create({
|
|
1279
|
-
* model: 'gpt-
|
|
1323
|
+
* model: 'gpt-5.2',
|
|
1280
1324
|
* messages: [{ role: 'user', content: 'Hello!' }]
|
|
1281
1325
|
* });
|
|
1282
1326
|
*/
|
|
@@ -1383,7 +1427,7 @@ declare class Chat {
|
|
|
1383
1427
|
* const client = new OpenAI({ walletKey: '0x...' });
|
|
1384
1428
|
*
|
|
1385
1429
|
* const response = await client.chat.completions.create({
|
|
1386
|
-
* model: 'gpt-
|
|
1430
|
+
* model: 'gpt-5.2',
|
|
1387
1431
|
* messages: [{ role: 'user', content: 'Hello!' }]
|
|
1388
1432
|
* });
|
|
1389
1433
|
*
|
|
@@ -1418,4 +1462,59 @@ declare class AnthropicClient {
|
|
|
1418
1462
|
getWalletAddress(): string;
|
|
1419
1463
|
}
|
|
1420
1464
|
|
|
1421
|
-
|
|
1465
|
+
/**
|
|
1466
|
+
* Input validation and security utilities for BlockRun LLM SDK.
|
|
1467
|
+
*
|
|
1468
|
+
* This module provides validation functions to ensure:
|
|
1469
|
+
* - Private keys are properly formatted
|
|
1470
|
+
* - API URLs use HTTPS
|
|
1471
|
+
* - Server responses don't leak sensitive information
|
|
1472
|
+
* - Resource URLs match expected domains
|
|
1473
|
+
*/
|
|
1474
|
+
|
|
1475
|
+
/**
|
|
1476
|
+
* Known LLM providers (for optional validation).
|
|
1477
|
+
*/
|
|
1478
|
+
declare const KNOWN_PROVIDERS: Set<string>;
|
|
1479
|
+
/**
|
|
1480
|
+
* Validates that a model ID is a non-empty string.
|
|
1481
|
+
*
|
|
1482
|
+
* @param model - The model ID (e.g., "openai/gpt-5.2", "anthropic/claude-sonnet-4.5")
|
|
1483
|
+
* @throws {Error} If the model is invalid
|
|
1484
|
+
*
|
|
1485
|
+
* @example
|
|
1486
|
+
* validateModel("openai/gpt-5.2");
|
|
1487
|
+
*/
|
|
1488
|
+
declare function validateModel(model: string): void;
|
|
1489
|
+
/**
|
|
1490
|
+
* Validates that max_tokens is an integer between 1 and 100,000.
|
|
1491
|
+
*
|
|
1492
|
+
* @param maxTokens - Maximum number of tokens to generate
|
|
1493
|
+
* @throws {Error} If maxTokens is invalid
|
|
1494
|
+
*
|
|
1495
|
+
* @example
|
|
1496
|
+
* validateMaxTokens(1000);
|
|
1497
|
+
*/
|
|
1498
|
+
declare function validateMaxTokens(maxTokens?: number): void;
|
|
1499
|
+
/**
|
|
1500
|
+
* Validates that temperature is a number between 0 and 2.
|
|
1501
|
+
*
|
|
1502
|
+
* @param temperature - Sampling temperature (0-2)
|
|
1503
|
+
* @throws {Error} If temperature is invalid
|
|
1504
|
+
*
|
|
1505
|
+
* @example
|
|
1506
|
+
* validateTemperature(0.7);
|
|
1507
|
+
*/
|
|
1508
|
+
declare function validateTemperature(temperature?: number): void;
|
|
1509
|
+
/**
|
|
1510
|
+
* Validates that top_p is a number between 0 and 1.
|
|
1511
|
+
*
|
|
1512
|
+
* @param topP - Top-p sampling parameter (0-1)
|
|
1513
|
+
* @throws {Error} If topP is invalid
|
|
1514
|
+
*
|
|
1515
|
+
* @example
|
|
1516
|
+
* validateTopP(0.9);
|
|
1517
|
+
*/
|
|
1518
|
+
declare function validateTopP(topP?: number): void;
|
|
1519
|
+
|
|
1520
|
+
export { APIError, AnthropicClient, BASE_CHAIN_ID, type BlockRunAnthropicOptions, BlockrunError, type ChatChoice, type ChatCompletionOptions, type ChatMessage, type ChatOptions, type ChatResponse, type ChatResponseWithCost, type ChatUsage, type CostEntry, type CostEstimate, type CreatePaymentOptions, type FunctionCall, type FunctionDefinition, ImageClient, type ImageClientOptions, type ImageData, type ImageEditOptions, type ImageGenerateOptions, type ImageModel, type ImageResponse, KNOWN_PROVIDERS, LLMClient, type LLMClientOptions, type Model, type NewsSearchSource, OpenAI, type OpenAIChatCompletionChoice, type OpenAIChatCompletionChunk, type OpenAIChatCompletionParams, type OpenAIChatCompletionResponse, type OpenAIClientOptions, PaymentError, type PaymentLinks, type RoutingDecision, type RoutingProfile, type RoutingTier, type RssSearchSource, SOLANA_NETWORK, SOLANA_WALLET_FILE as SOLANA_WALLET_FILE_PATH, type SearchOptions, type SearchParameters, type SearchResult, type SearchSource, type SearchUsage, type SmartChatOptions, type SmartChatResponse, SolanaLLMClient, type SolanaLLMClientOptions, type SolanaWalletInfo, type Spending, type SpendingReport, type Tool, type ToolCall, type ToolChoice, USDC_BASE, USDC_BASE_CONTRACT, USDC_SOLANA, WALLET_DIR_PATH, WALLET_FILE_PATH, type WalletInfo, type WebSearchSource, type XArticlesRisingResponse, type XAuthorAnalyticsResponse, type XCompareAuthorsResponse, type XFollower, type XFollowersResponse, type XFollowingsResponse, type XMentionsResponse, type XSearchResponse, type XSearchSource, type XTrendingResponse, type XTweet, type XTweetLookupResponse, type XTweetRepliesResponse, type XTweetThreadResponse, type XTweetsResponse, type XUser, type XUserInfoResponse, type XUserLookupResponse, type XVerifiedFollowersResponse, clearCache, createPaymentPayload, createSolanaPaymentPayload, createSolanaWallet, createWallet, LLMClient as default, extractPaymentDetails, formatFundingMessageCompact, formatNeedsFundingMessage, formatWalletCreatedMessage, getCached, getCachedByRequest, getCostLogSummary, getCostSummary, getEip681Uri, getOrCreateSolanaWallet, getOrCreateWallet, getPaymentLinks, getWalletAddress, loadSolanaWallet, loadWallet, logCost, parsePaymentRequired, saveSolanaWallet, saveToCache, saveWallet, scanSolanaWallets, scanWallets, setCache, setupAgentSolanaWallet, setupAgentWallet, solanaClient, solanaKeyToBytes, solanaPublicKey, status, testnetClient, validateMaxTokens, validateModel, validateTemperature, validateTopP };
|