@juspay/neurolink 9.67.1 → 9.67.2
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 +2 -0
- package/dist/browser/neurolink.min.js +342 -342
- package/dist/lib/providers/googleVertex.js +8 -7
- package/dist/lib/providers/litellm.d.ts +31 -24
- package/dist/lib/providers/litellm.js +590 -391
- package/dist/lib/providers/openaiChatCompletionsClient.d.ts +67 -0
- package/dist/lib/providers/openaiChatCompletionsClient.js +526 -0
- package/dist/lib/providers/openaiCompatible.js +6 -516
- package/dist/lib/types/providers.d.ts +2 -0
- package/dist/providers/googleVertex.js +8 -7
- package/dist/providers/litellm.d.ts +31 -24
- package/dist/providers/litellm.js +590 -391
- package/dist/providers/openaiChatCompletionsClient.d.ts +67 -0
- package/dist/providers/openaiChatCompletionsClient.js +525 -0
- package/dist/providers/openaiCompatible.js +6 -516
- package/dist/types/providers.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type { ZodType } from "zod";
|
|
2
1
|
import type { AIProviderName } from "../constants/enums.js";
|
|
3
2
|
import { BaseProvider } from "../core/baseProvider.js";
|
|
4
|
-
import type { StreamOptions, StreamResult } from "../types/index.js";
|
|
5
|
-
import type { LanguageModel, Schema } from "../types/index.js";
|
|
3
|
+
import type { LanguageModel, Schema, StreamOptions, StreamResult, ZodUnknownSchema } from "../types/index.js";
|
|
6
4
|
/**
|
|
7
|
-
* LiteLLM Provider
|
|
8
|
-
*
|
|
5
|
+
* LiteLLM Provider — direct HTTP, no AI SDK. Talks to a LiteLLM proxy
|
|
6
|
+
* server (or any deployment that speaks OpenAI chat-completions + the
|
|
7
|
+
* `/v1/models` and `/v1/embeddings` endpoints).
|
|
9
8
|
*/
|
|
10
9
|
export declare class LiteLLMProvider extends BaseProvider {
|
|
11
|
-
private
|
|
10
|
+
private config;
|
|
12
11
|
private credentials?;
|
|
12
|
+
private resolvedModel?;
|
|
13
13
|
private static modelsCache;
|
|
14
14
|
private static modelsCacheTime;
|
|
15
15
|
private static readonly MODELS_CACHE_DURATION;
|
|
@@ -20,38 +20,45 @@ export declare class LiteLLMProvider extends BaseProvider {
|
|
|
20
20
|
protected getProviderName(): AIProviderName;
|
|
21
21
|
protected getDefaultModel(): string;
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
* Abstract from BaseProvider — used by the parent's generate() path which
|
|
24
|
+
* still goes through `generateText`. Returns a thin LanguageModelV3-shaped
|
|
25
|
+
* object that delegates to the same HTTP helpers used by executeStream.
|
|
24
26
|
*/
|
|
25
|
-
protected getAISDKModel(): LanguageModel
|
|
26
|
-
|
|
27
|
+
protected getAISDKModel(): Promise<LanguageModel>;
|
|
28
|
+
private resolveModelName;
|
|
27
29
|
/**
|
|
28
|
-
*
|
|
30
|
+
* Returns a minimal V3-shaped model. Only used by BaseProvider's
|
|
31
|
+
* `generate()` non-streaming path which still relies on the parent's
|
|
32
|
+
* `generateText`. The streaming path bypasses this entirely.
|
|
29
33
|
*/
|
|
34
|
+
private buildDelegatingModel;
|
|
35
|
+
formatProviderError(error: unknown): Error;
|
|
30
36
|
supportsTools(): boolean;
|
|
31
37
|
/**
|
|
32
|
-
*
|
|
33
|
-
*
|
|
38
|
+
* Streaming path — drives the LiteLLM proxy directly. No streamText, no
|
|
39
|
+
* AI SDK orchestrator. Tool calls, multi-step loops, telemetry, abort
|
|
40
|
+
* handling all inline. OTel span captures gen_ai.system + cost.
|
|
34
41
|
*/
|
|
35
|
-
protected executeStream(options: StreamOptions,
|
|
36
|
-
private
|
|
42
|
+
protected executeStream(options: StreamOptions, _analysisSchema?: ZodUnknownSchema | Schema<unknown>): Promise<StreamResult>;
|
|
43
|
+
private runStreamLoop;
|
|
44
|
+
private streamOneStep;
|
|
45
|
+
private executeToolBatch;
|
|
37
46
|
/**
|
|
38
|
-
* Generate an embedding for a single text input
|
|
39
|
-
* Uses the LiteLLM proxy with OpenAI-compatible embedding API
|
|
47
|
+
* Generate an embedding for a single text input via native /v1/embeddings.
|
|
40
48
|
*/
|
|
41
49
|
embed(text: string, modelName?: string): Promise<number[]>;
|
|
42
50
|
/**
|
|
43
|
-
* Generate embeddings for multiple text inputs
|
|
44
|
-
* Uses the LiteLLM proxy with OpenAI-compatible embedding API
|
|
51
|
+
* Generate embeddings for multiple text inputs via native /v1/embeddings.
|
|
45
52
|
*/
|
|
46
53
|
embedMany(texts: string[], modelName?: string): Promise<number[][]>;
|
|
54
|
+
private callEmbeddings;
|
|
47
55
|
/**
|
|
48
|
-
* Get available models from LiteLLM proxy
|
|
49
|
-
*
|
|
56
|
+
* Get available models from LiteLLM proxy `/v1/models` endpoint.
|
|
57
|
+
* Caches results for 10 minutes; falls back to env-driven list or a
|
|
58
|
+
* minimal safe default if the API fetch fails.
|
|
50
59
|
*/
|
|
51
60
|
getAvailableModels(): Promise<string[]>;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
* @private
|
|
55
|
-
*/
|
|
61
|
+
getFirstAvailableModel(): Promise<string>;
|
|
62
|
+
private getFallbackModels;
|
|
56
63
|
private fetchModelsFromAPI;
|
|
57
64
|
}
|