@standardagents/openrouter 0.14.0 → 0.15.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/dist/index.d.ts +25 -1
- package/dist/index.js +1440 -1116
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LLMProviderInterface, ProviderFactoryConfig, ModelCapabilities, ProviderModelInfo, ProviderRequest, ProviderResponse, ProviderStreamChunk, ResponseSummary, InspectedRequest, ProviderFactoryWithOptions } from '@standardagents/spec';
|
|
1
|
+
import { LLMProviderInterface, ProviderFactoryConfig, ToolDefinition, ToolArgs, ToolTenvs, ModelCapabilities, ProviderModelInfo, ProviderRequest, ProviderResponse, ProviderStreamChunk, ResponseSummary, InspectedRequest, ProviderFactoryWithOptions } from '@standardagents/spec';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -35,6 +35,17 @@ import { z } from 'zod';
|
|
|
35
35
|
* useResponsesApi: true,
|
|
36
36
|
* }
|
|
37
37
|
* ```
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```typescript
|
|
41
|
+
* // Configure OpenRouter provider-executed server tools
|
|
42
|
+
* providerOptions: {
|
|
43
|
+
* serverTools: {
|
|
44
|
+
* web_search: { max_results: 5 },
|
|
45
|
+
* datetime: { timezone: 'America/New_York' },
|
|
46
|
+
* },
|
|
47
|
+
* }
|
|
48
|
+
* ```
|
|
38
49
|
*/
|
|
39
50
|
declare const openrouterProviderOptions: z.ZodObject<{
|
|
40
51
|
provider: z.ZodOptional<z.ZodObject<{
|
|
@@ -95,6 +106,12 @@ declare const openrouterProviderOptions: z.ZodObject<{
|
|
|
95
106
|
enforce_distillable_text: z.ZodOptional<z.ZodBoolean>;
|
|
96
107
|
}, z.core.$loose>>;
|
|
97
108
|
useResponsesApi: z.ZodOptional<z.ZodBoolean>;
|
|
109
|
+
serverTools: z.ZodOptional<z.ZodObject<{
|
|
110
|
+
web_search: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
111
|
+
web_fetch: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
112
|
+
datetime: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
113
|
+
image_generation: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
114
|
+
}, z.core.$strip>>;
|
|
98
115
|
}, z.core.$loose>;
|
|
99
116
|
/**
|
|
100
117
|
* TypeScript type for OpenRouter provider options.
|
|
@@ -129,6 +146,8 @@ declare class OpenRouterProvider implements LLMProviderInterface {
|
|
|
129
146
|
private client;
|
|
130
147
|
private config;
|
|
131
148
|
constructor(config: OpenRouterConfig);
|
|
149
|
+
private static readonly SERVER_TOOL_RESULT;
|
|
150
|
+
private static readonly TOOLS;
|
|
132
151
|
/**
|
|
133
152
|
* Determine which API to use for a request.
|
|
134
153
|
* Checks request-level providerOptions first, then falls back to config.
|
|
@@ -136,7 +155,12 @@ declare class OpenRouterProvider implements LLMProviderInterface {
|
|
|
136
155
|
*/
|
|
137
156
|
private getApiMode;
|
|
138
157
|
private getClient;
|
|
158
|
+
private applyConfiguredProvidersToResponses;
|
|
159
|
+
private hasOpenRouterServerTools;
|
|
160
|
+
private toSdkResponsesRequest;
|
|
161
|
+
private throwOpenRouterFetchError;
|
|
139
162
|
supportsModel(_modelId: string): boolean;
|
|
163
|
+
getTools(_modelId?: string): Record<string, ToolDefinition<any, ToolArgs | null, ToolTenvs | null>>;
|
|
140
164
|
/**
|
|
141
165
|
* Get the icon for a model as a data URI.
|
|
142
166
|
* Extracts the AI lab/organization from the model ID prefix and returns
|