@juspay/neurolink 12.42.0 → 12.43.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.
@@ -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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juspay/neurolink",
3
- "version": "12.42.0",
3
+ "version": "12.43.0",
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": {
@@ -362,6 +362,11 @@
362
362
  "import": "./dist/avatar/index.js",
363
363
  "default": "./dist/avatar/index.js"
364
364
  },
365
+ "./autoresearch": {
366
+ "types": "./dist/autoresearch/index.d.ts",
367
+ "import": "./dist/autoresearch/index.js",
368
+ "default": "./dist/autoresearch/index.js"
369
+ },
365
370
  "./image-gen": {
366
371
  "types": "./dist/image-gen/index.d.ts",
367
372
  "import": "./dist/image-gen/index.js",