@juspay/neurolink 12.42.1 → 12.43.1

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.
@@ -4,6 +4,8 @@ import { getProviderModel, resolveOpenAICompatConfig, } from "../utils/providerC
4
4
  import { classifyProviderError } from "../utils/errorClassifier.js";
5
5
  import { TimeoutError } from "../utils/timeout.js";
6
6
  import { OpenAIChatCompletionsProvider } from "./openaiChatCompletionsBase.js";
7
+ const PERPLEXITY_API_HOST = "api.perplexity.ai";
8
+ const PERPLEXITY_INTEGRATION = "neurolink";
7
9
  /**
8
10
  * Collapse OpenAI's `content` union down to the plain string that
9
11
  * string-only vendors accept. Image parts carry no string representation and
@@ -105,10 +107,16 @@ export class ConfiguredOpenAICompatProvider extends OpenAIChatCompletionsProvide
105
107
  * its `api-key` header.
106
108
  */
107
109
  getAuthHeaders() {
108
- if (this.entry.authHeaderStyle === "x-api-key") {
109
- return { "X-Api-Key": this.config.apiKey };
110
+ const headers = this.entry.authHeaderStyle === "x-api-key"
111
+ ? { "X-Api-Key": this.config.apiKey }
112
+ : super.getAuthHeaders();
113
+ // Perplexity asks to identify NeuroLink on its own API host only; a
114
+ // custom Perplexity-compatible endpoint gets no attribution header.
115
+ if (this.entry.providerName === "perplexity" &&
116
+ new URL(this.config.baseURL).hostname === PERPLEXITY_API_HOST) {
117
+ headers["X-Pplx-Integration"] = PERPLEXITY_INTEGRATION;
110
118
  }
111
- return super.getAuthHeaders();
119
+ return headers;
112
120
  }
113
121
  /**
114
122
  * The catalog's `capabilities.tools` is the vendor's own answer, probed on
@@ -356,6 +356,11 @@ function fitRequestToTarget(payload, targetModel) {
356
356
  logger.warn(`[vertex-anthropic] ${targetModel} rejects tool_choice "${choice.type}"; sending "auto" instead`);
357
357
  }
358
358
  const thinking = payload.thinking;
359
+ if (record(thinking) && thinking.display === "updates") {
360
+ // Claude Code requests live thinking updates, but Vertex accepts only
361
+ // summarized or omitted adaptive thinking display.
362
+ payload.thinking = { ...thinking, display: "summarized" };
363
+ }
359
364
  if (record(thinking) && thinking.type === "disabled") {
360
365
  const outputConfig = payload.output_config;
361
366
  const effort = record(outputConfig) && typeof outputConfig.effort === "string"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juspay/neurolink",
3
- "version": "12.42.1",
3
+ "version": "12.43.1",
4
4
  "packageManager": "pnpm@10.15.1",
5
5
  "description": "The pipe layer of an AI nervous system: one interface connecting provider neurons to your application, across three inference types — generate, stream and decide. `decide` returns typed, calibrated judgements from a non-generative model (~400ms, ~$0.00002/call) for routing, tool selection and context budgeting. MCP-native (4 transports), voice TTS/STT/realtime, RAG, agents, memory, compaction, 9 observability exporters. OpenAI · Anthropic · Gemini · Bedrock · Azure · Ollama · TypeSafe Jev and more.",
6
6
  "author": {