@hebo-ai/gateway 0.11.3 → 0.11.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/README.md CHANGED
@@ -251,7 +251,7 @@ Out-of-the-box model presets:
251
251
  Voyage: `voyage` (`v2`, `v3`, `v3.5`, `v4`, `v2.x`, `v3.x`, `v4.x`, `latest`, `all`)
252
252
 
253
253
  - **xAI** — `@hebo-ai/gateway/models/xai`
254
- Grok: `grok` (`v4.1`, `v4.2`, `latest`, `all`)
254
+ Grok: `grok` (`v4.1`, `v4.2`, `v4.3`, `latest`, `all`)
255
255
 
256
256
  - **Z.ai** — `@hebo-ai/gateway/models/zai`
257
257
  GLM: `glm` (`v5`, `v5.1`, `v5.x`, `latest`, `all`)
@@ -194,11 +194,11 @@ export function fromChatCompletionsContent(content) {
194
194
  return content.map((part) => {
195
195
  switch (part.type) {
196
196
  case "image_url":
197
- return fromImageUrlPart(part.image_url.url, part.cache_control);
197
+ return fromImageUrlPart(part.image_url.url, part.cache_control ?? undefined);
198
198
  case "file":
199
- return fromFilePart(part.file.data, part.file.media_type, part.file.filename, part.cache_control);
199
+ return fromFilePart(part.file.data, part.file.media_type, part.file.filename ?? undefined, part.cache_control ?? undefined);
200
200
  case "input_audio":
201
- return fromFilePart(part.input_audio.data, `audio/${part.input_audio.format}`, undefined, part.cache_control);
201
+ return fromFilePart(part.input_audio.data, `audio/${part.input_audio.format}`, undefined, part.cache_control ?? undefined);
202
202
  case "text": {
203
203
  const out = {
204
204
  type: "text",
@@ -266,13 +266,19 @@ export const convertToToolSet = (tools) => {
266
266
  }
267
267
  const toolSet = {};
268
268
  for (const t of tools) {
269
- toolSet[t.function.name] = tool({
270
- description: t.function.description,
271
- inputSchema: jsonSchema(t.function.parameters),
272
- strict: t.function.strict,
269
+ // Hosted/built-in tools (e.g. web_search) are accepted at the edge but
270
+ // not executed by the gateway; drop anything that isn't a function tool.
271
+ // FUTURE: log dropped hosted tools at warn level (once per request, batched)
272
+ if (t.type !== "function")
273
+ continue;
274
+ const fn = t;
275
+ toolSet[fn.function.name] = tool({
276
+ description: fn.function.description,
277
+ inputSchema: jsonSchema(fn.function.parameters),
278
+ strict: fn.function.strict,
273
279
  });
274
280
  }
275
- return toolSet;
281
+ return Object.keys(toolSet).length > 0 ? toolSet : undefined;
276
282
  };
277
283
  export const convertToToolChoiceOptions = (toolChoice) => {
278
284
  if (!toolChoice) {