@agent-api/sdk 1.0.3 → 1.0.4

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/CHANGELOG.md CHANGED
@@ -1,11 +1,18 @@
1
1
  # Changelog — @agent-api/sdk
2
2
 
3
+ ## 1.0.4
4
+
5
+ ### Added
6
+
7
+ - `preferred_sites` create-run parameter (up to 3 hostnames) to bias web search and fetch toward specific domains when allowed tools include `web_search` or `web_fetch`.
8
+
3
9
  ## 1.0.3
4
10
 
5
11
  ### Added
6
12
 
7
13
  - Workbench volume APIs: `summarize`, `grep`, `readLines`, `patchLines`, `downloadArchive`.
8
14
  - `responses.retrieveVolume` for `GET /v1/responses/{response_id}/volume`.
15
+ - Create-run params `model_routing` (`auto` | `chain`) and `routing_strategy` (`balanced` | `high-quality` | `cost-effective`) for platform model selection when `model_routing` is `auto`.
9
16
 
10
17
  ### Changed
11
18
 
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Production JavaScript/TypeScript SDK for the Managed Agent API.
4
4
 
5
- **Published on npm:** [`@agent-api/sdk`](https://www.npmjs.com/package/@agent-api/sdk) (v1.0.2)
5
+ **Published on npm:** [`@agent-api/sdk`](https://www.npmjs.com/package/@agent-api/sdk) (v1.0.4)
6
6
 
7
7
  ## Install
8
8
 
@@ -106,6 +106,21 @@ for await (const event of stream) {
106
106
  }
107
107
  ```
108
108
 
109
+ ## Model routing
110
+
111
+ Use `model_routing: "auto"` to let the platform pick a model (openmark). Optionally constrain the pool with `models`, and tune selection with `routing_strategy`:
112
+
113
+ ```typescript
114
+ const response = await client.responses.create({
115
+ input: "Compare two cloud providers for ML workloads.",
116
+ model_routing: "auto",
117
+ routing_strategy: "cost-effective",
118
+ models: ["openai/gpt-5.4", "google/gemini-3-flash-preview"],
119
+ });
120
+ ```
121
+
122
+ Use model ids in vendor/model form (values from `client.models.list()`). Omit `model_routing` (or set `"chain"`) for strict fallback order via `model` / `models`. `routing_strategy` is only valid when `model_routing` is `"auto"`.
123
+
109
124
  ## Client options
110
125
 
111
126
  ```typescript
@@ -3,6 +3,8 @@ export type JSONValue = JSONPrimitive | JSONValue[] | {
3
3
  [key: string]: JSONValue;
4
4
  };
5
5
  export type AgentCapabilityPreference = "off" | "auto" | "preferred" | "required";
6
+ export type ModelRoutingMode = "auto" | "chain";
7
+ export type ModelRoutingStrategy = "balanced" | "high-quality" | "cost-effective";
6
8
  export interface ClientOptions {
7
9
  apiKey?: string;
8
10
  baseURL?: string;
@@ -1,4 +1,4 @@
1
- import type { AgentCapabilityPreference, ErrorInfo, OutputItemStatus, ResponseStatus, Usage } from "./common.js";
1
+ import type { AgentCapabilityPreference, ErrorInfo, ModelRoutingMode, ModelRoutingStrategy, OutputItemStatus, ResponseStatus, Usage } from "./common.js";
2
2
  import type { ContentPart, Input, MemoryOptions, ReasoningConfig, ResponseFormat } from "./input.js";
3
3
  import type { Tool } from "./tools.js";
4
4
  export interface ResponseCreateParamsBase {
@@ -7,6 +7,8 @@ export interface ResponseCreateParamsBase {
7
7
  language_preference?: string;
8
8
  model?: string;
9
9
  models?: string[];
10
+ model_routing?: ModelRoutingMode;
11
+ routing_strategy?: ModelRoutingStrategy;
10
12
  preset?: "fast-search" | "pro-search" | "deep-research" | "advanced-deep-research" | string;
11
13
  max_output_tokens?: number;
12
14
  max_steps?: number;
@@ -19,6 +21,7 @@ export interface ResponseCreateParamsBase {
19
21
  store?: boolean;
20
22
  previous_response_id?: string;
21
23
  volume_id?: string;
24
+ preferred_sites?: string[];
22
25
  prompt_cache_key?: string;
23
26
  memory?: MemoryOptions;
24
27
  plan_mode_preference?: AgentCapabilityPreference;
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.0.3";
2
- export declare const USER_AGENT = "@agent-api/sdk/1.0.3";
1
+ export declare const VERSION = "1.0.4";
2
+ export declare const USER_AGENT = "@agent-api/sdk/1.0.4";
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = "1.0.3";
1
+ export const VERSION = "1.0.4";
2
2
  export const USER_AGENT = `@agent-api/sdk/${VERSION}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-api/sdk",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Production JavaScript SDK for the Managed Agent API",
5
5
  "license": "MIT",
6
6
  "repository": {