@juspay/neurolink 12.43.3 → 12.44.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.
Files changed (34) hide show
  1. package/CHANGELOG.md +3 -2
  2. package/README.md +94 -71
  3. package/dist/browser/neurolink.min.js +393 -393
  4. package/dist/cli/commands/decide.d.ts +1 -1
  5. package/dist/cli/commands/decide.js +3 -3
  6. package/dist/cli/commands/setup.js +2 -1
  7. package/dist/cli/factories/commandFactory.js +1 -1
  8. package/dist/constants/enums.d.ts +13 -0
  9. package/dist/constants/enums.js +14 -0
  10. package/dist/factories/providerDescriptors.d.ts +8 -2
  11. package/dist/factories/providerDescriptors.js +75 -5
  12. package/dist/factories/providerRegistry.js +11 -1
  13. package/dist/models/manifestRegistry.js +2 -0
  14. package/dist/models/manifests/perplexityDecider.d.ts +14 -0
  15. package/dist/models/manifests/perplexityDecider.js +32 -0
  16. package/dist/neurolink.d.ts +13 -0
  17. package/dist/neurolink.js +57 -2
  18. package/dist/providers/perplexityDecider.d.ts +50 -0
  19. package/dist/providers/perplexityDecider.js +373 -0
  20. package/dist/providers/systemOneDecision.d.ts +12 -0
  21. package/dist/providers/systemOneDecision.js +48 -4
  22. package/dist/types/classifierRouter.d.ts +7 -5
  23. package/dist/types/cli.d.ts +2 -1
  24. package/dist/types/decision.d.ts +5 -0
  25. package/dist/types/providers.d.ts +11 -0
  26. package/dist/utils/decisionBatches.d.ts +24 -0
  27. package/dist/utils/decisionBatches.js +58 -0
  28. package/dist/utils/logSanitize.js +12 -0
  29. package/dist/utils/modelChoices.js +9 -1
  30. package/dist/utils/pricing.js +8 -0
  31. package/dist/utils/providerConfig.d.ts +6 -0
  32. package/dist/utils/providerConfig.js +18 -0
  33. package/docs-site/static/search-index.json +82 -59
  34. package/package.json +2 -1
@@ -2,7 +2,7 @@
2
2
  * Centralized model choices for CLI commands
3
3
  * Derives choices from model enums to ensure consistency
4
4
  */
5
- import { AIProviderName, OpenAIModels, AnthropicModels, GoogleAIModels, BedrockModels, VertexModels, OllamaModels, AzureOpenAIModels, LiteLLMModels, SageMakerModels, OpenRouterModels, NvidiaNimModels, CohereModels, VoyageModels, JinaModels, StabilityModels, IdeogramModels, RecraftModels, TypeSafeModels, LayaModels, XorModels, ReplicateModels, } from "../constants/enums.js";
5
+ import { AIProviderName, OpenAIModels, AnthropicModels, GoogleAIModels, BedrockModels, VertexModels, OllamaModels, AzureOpenAIModels, LiteLLMModels, SageMakerModels, OpenRouterModels, NvidiaNimModels, CohereModels, VoyageModels, JinaModels, StabilityModels, IdeogramModels, RecraftModels, TypeSafeModels, LayaModels, XorModels, PerplexityDeciderModels, ReplicateModels, } from "../constants/enums.js";
6
6
  import { getCatalogJsonEntries } from "../providers/catalog/loader.js";
7
7
  /**
8
8
  * Looks up the JSON catalog entry for a provider, if it is one of the 11
@@ -393,6 +393,12 @@ const TOP_MODELS_CONFIG = {
393
393
  description: "Recommended - XOR 1.1, decision model that also reads images and video",
394
394
  },
395
395
  ],
396
+ [AIProviderName.PERPLEXITY_DECIDER]: [
397
+ {
398
+ model: PerplexityDeciderModels.PPLX_DECIDER_V1_27B,
399
+ description: "Recommended - Perplexity decision model that also reads images",
400
+ },
401
+ ],
396
402
  [AIProviderName.AUTO]: [],
397
403
  };
398
404
  /**
@@ -434,6 +440,7 @@ export const DEFAULT_MODELS = {
434
440
  [AIProviderName.TYPESAFE]: TypeSafeModels.JEV_LATEST,
435
441
  [AIProviderName.LAYA]: LayaModels.TYPED_DECISIONS,
436
442
  [AIProviderName.XOR]: XorModels.XOR_1_1,
443
+ [AIProviderName.PERPLEXITY_DECIDER]: PerplexityDeciderModels.PPLX_DECIDER_V1_27B,
437
444
  };
438
445
  /**
439
446
  * Model enum mappings for getAllModels.
@@ -468,6 +475,7 @@ const MODEL_ENUMS = {
468
475
  [AIProviderName.TYPESAFE]: TypeSafeModels,
469
476
  [AIProviderName.LAYA]: LayaModels,
470
477
  [AIProviderName.XOR]: XorModels,
478
+ [AIProviderName.PERPLEXITY_DECIDER]: PerplexityDeciderModels,
471
479
  [AIProviderName.AUTO]: null,
472
480
  };
473
481
  /**
@@ -780,6 +780,14 @@ const PRICING = {
780
780
  _default: { input: 0.042 / 1_000_000, output: 0 },
781
781
  "jev-latest": { input: 0.042 / 1_000_000, output: 0 },
782
782
  },
783
+ "perplexity-decider": {
784
+ // The Decisions API bills $0.04 per million INPUT tokens (image tokens
785
+ // included) and charges nothing for output or per request. `output: 0` is
786
+ // a price, not a token count, so do not "correct" it from
787
+ // `usage.output_tokens`. Rate from the API reference (checked 2026-10-02).
788
+ _default: { input: 0.04 / 1_000_000, output: 0 },
789
+ "pplx-decider-v1-27b": { input: 0.04 / 1_000_000, output: 0 },
790
+ },
783
791
  stability: {
784
792
  // Stability AI bills per image; symbolic per-token rate.
785
793
  _default: { input: 0, output: 0.04 / 1_000 },
@@ -410,3 +410,9 @@ export declare function createLayaConfig(): ProviderConfigOptions;
410
410
  * built-in endpoint: XOR_BASE_URL is required alongside the key.
411
411
  */
412
412
  export declare function createXorConfig(): ProviderConfigOptions;
413
+ /**
414
+ * Perplexity Decisions API — the `decide` inference type, not the Sonar text
415
+ * models. It reads the same PERPLEXITY_API_KEY as the `perplexity` text
416
+ * provider and has a public endpoint, so the key alone configures it.
417
+ */
418
+ export declare function createPerplexityDeciderConfig(): ProviderConfigOptions;
@@ -1358,3 +1358,21 @@ export function createXorConfig() {
1358
1358
  ],
1359
1359
  };
1360
1360
  }
1361
+ /**
1362
+ * Perplexity Decisions API — the `decide` inference type, not the Sonar text
1363
+ * models. It reads the same PERPLEXITY_API_KEY as the `perplexity` text
1364
+ * provider and has a public endpoint, so the key alone configures it.
1365
+ */
1366
+ export function createPerplexityDeciderConfig() {
1367
+ return {
1368
+ providerName: "Perplexity Decisions",
1369
+ envVarName: "PERPLEXITY_API_KEY",
1370
+ setupUrl: "https://console.perplexity.ai",
1371
+ description: "API key for the Perplexity Decisions API",
1372
+ instructions: [
1373
+ "1. Create an API key in the Perplexity console (https://console.perplexity.ai)",
1374
+ "2. Set PERPLEXITY_API_KEY; it is the same key the Perplexity text provider reads, so setting it also lets decide() use Perplexity when no other decision provider is configured",
1375
+ "3. Optionally set PERPLEXITY_DECIDER_BASE_URL to an origin other than https://api.perplexity.ai (NeuroLink calls <base>/v1/decisions)",
1376
+ ],
1377
+ };
1378
+ }