@juspay/neurolink 9.67.0 → 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 +4 -0
- package/dist/browser/neurolink.min.js +376 -370
- 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.d.ts +46 -19
- package/dist/lib/providers/openaiCompatible.js +559 -171
- package/dist/lib/types/index.d.ts +1 -0
- package/dist/lib/types/index.js +1 -0
- package/dist/lib/types/middleware.d.ts +1 -1
- package/dist/lib/types/openaiCompatible.d.ts +250 -0
- package/dist/lib/types/openaiCompatible.js +2 -0
- 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.d.ts +46 -19
- package/dist/providers/openaiCompatible.js +559 -171
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/middleware.d.ts +1 -1
- package/dist/types/openaiCompatible.d.ts +250 -0
- package/dist/types/openaiCompatible.js +1 -0
- package/dist/types/providers.d.ts +2 -0
- package/package.json +2 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -35,6 +35,7 @@ export * from "./middleware.js";
|
|
|
35
35
|
export * from "./model.js";
|
|
36
36
|
export * from "./multimodal.js";
|
|
37
37
|
export * from "./observability.js";
|
|
38
|
+
export * from "./openaiCompatible.js";
|
|
38
39
|
export * from "./ppt.js";
|
|
39
40
|
export * from "./processor.js";
|
|
40
41
|
export * from "./providers.js";
|
package/dist/types/index.js
CHANGED
|
@@ -36,6 +36,7 @@ export * from "./middleware.js";
|
|
|
36
36
|
export * from "./model.js";
|
|
37
37
|
export * from "./multimodal.js";
|
|
38
38
|
export * from "./observability.js";
|
|
39
|
+
export * from "./openaiCompatible.js";
|
|
39
40
|
export * from "./ppt.js";
|
|
40
41
|
export * from "./processor.js";
|
|
41
42
|
export * from "./providers.js";
|
|
@@ -3,7 +3,7 @@ import type { EvaluationData, GetPromptFunction } from "./evaluation.js";
|
|
|
3
3
|
import type { AuthenticatedUser, RouteDefinition, ServerContext } from "./server.js";
|
|
4
4
|
import type { LanguageModelMiddleware as BaseLanguageModelMiddleware } from "ai";
|
|
5
5
|
export type { LanguageModelMiddleware } from "ai";
|
|
6
|
-
export type { LanguageModelV3, LanguageModelV3CallOptions, LanguageModelV3Message, LanguageModelV3StreamPart, LanguageModelV3ToolCall, LanguageModelV3ToolChoice, LanguageModelV3Source, LanguageModelV3Middleware, JSONSchema7, } from "@ai-sdk/provider";
|
|
6
|
+
export type { LanguageModelV3, LanguageModelV3CallOptions, LanguageModelV3Message, LanguageModelV3Prompt, LanguageModelV3StreamPart, LanguageModelV3ToolCall, LanguageModelV3ToolChoice, LanguageModelV3Source, LanguageModelV3Middleware, JSONSchema7, } from "@ai-sdk/provider";
|
|
7
7
|
import type { LanguageModelV3 } from "@ai-sdk/provider";
|
|
8
8
|
export type LanguageModelV3GenerateResult = Awaited<ReturnType<LanguageModelV3["doGenerate"]>>;
|
|
9
9
|
export type LanguageModelV3StreamResult = Awaited<ReturnType<LanguageModelV3["doStream"]>>;
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import type { NeuroLinkEvents, TypedEventEmitter } from "./common.js";
|
|
2
|
+
import type { JSONSchema7 } from "./middleware.js";
|
|
3
|
+
import type { LanguageModelV3, LanguageModelV3CallOptions } from "./middleware.js";
|
|
4
|
+
import type { StreamOptions } from "./stream.js";
|
|
5
|
+
import type { Tool } from "./tools.js";
|
|
6
|
+
export type OpenAICompatChatRole = "system" | "user" | "assistant" | "tool";
|
|
7
|
+
export type OpenAICompatTextContent = {
|
|
8
|
+
type: "text";
|
|
9
|
+
text: string;
|
|
10
|
+
};
|
|
11
|
+
export type OpenAICompatImageURLContent = {
|
|
12
|
+
type: "image_url";
|
|
13
|
+
image_url: {
|
|
14
|
+
url: string;
|
|
15
|
+
detail?: "auto" | "low" | "high";
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export type OpenAICompatMessageContent = OpenAICompatTextContent | OpenAICompatImageURLContent;
|
|
19
|
+
export type OpenAICompatToolCallWire = {
|
|
20
|
+
id: string;
|
|
21
|
+
type: "function";
|
|
22
|
+
function: {
|
|
23
|
+
name: string;
|
|
24
|
+
arguments: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export type OpenAICompatChatMessage = {
|
|
28
|
+
role: "system";
|
|
29
|
+
content: string | OpenAICompatMessageContent[];
|
|
30
|
+
} | {
|
|
31
|
+
role: "user";
|
|
32
|
+
content: string | OpenAICompatMessageContent[];
|
|
33
|
+
} | {
|
|
34
|
+
role: "assistant";
|
|
35
|
+
content?: string | OpenAICompatMessageContent[] | null;
|
|
36
|
+
tool_calls?: OpenAICompatToolCallWire[];
|
|
37
|
+
} | {
|
|
38
|
+
role: "tool";
|
|
39
|
+
content: string;
|
|
40
|
+
tool_call_id: string;
|
|
41
|
+
};
|
|
42
|
+
export type OpenAICompatChatTool = {
|
|
43
|
+
type: "function";
|
|
44
|
+
function: {
|
|
45
|
+
name: string;
|
|
46
|
+
description?: string;
|
|
47
|
+
parameters: JSONSchema7;
|
|
48
|
+
strict?: boolean;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
export type OpenAICompatToolChoiceWire = "auto" | "none" | "required" | {
|
|
52
|
+
type: "function";
|
|
53
|
+
function: {
|
|
54
|
+
name: string;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
export type OpenAICompatResponseFormat = {
|
|
58
|
+
type: "text";
|
|
59
|
+
} | {
|
|
60
|
+
type: "json_object";
|
|
61
|
+
} | {
|
|
62
|
+
type: "json_schema";
|
|
63
|
+
json_schema: {
|
|
64
|
+
name: string;
|
|
65
|
+
schema: JSONSchema7;
|
|
66
|
+
description?: string;
|
|
67
|
+
strict?: boolean;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
export type OpenAICompatChatRequest = {
|
|
71
|
+
model: string;
|
|
72
|
+
messages: OpenAICompatChatMessage[];
|
|
73
|
+
stream?: boolean;
|
|
74
|
+
stream_options?: {
|
|
75
|
+
include_usage?: boolean;
|
|
76
|
+
};
|
|
77
|
+
max_tokens?: number;
|
|
78
|
+
max_completion_tokens?: number;
|
|
79
|
+
temperature?: number;
|
|
80
|
+
top_p?: number;
|
|
81
|
+
presence_penalty?: number;
|
|
82
|
+
frequency_penalty?: number;
|
|
83
|
+
seed?: number;
|
|
84
|
+
stop?: string[];
|
|
85
|
+
tools?: OpenAICompatChatTool[];
|
|
86
|
+
tool_choice?: OpenAICompatToolChoiceWire;
|
|
87
|
+
response_format?: OpenAICompatResponseFormat;
|
|
88
|
+
parallel_tool_calls?: boolean;
|
|
89
|
+
user?: string;
|
|
90
|
+
};
|
|
91
|
+
export type OpenAICompatUsage = {
|
|
92
|
+
prompt_tokens?: number;
|
|
93
|
+
completion_tokens?: number;
|
|
94
|
+
total_tokens?: number;
|
|
95
|
+
prompt_tokens_details?: {
|
|
96
|
+
cached_tokens?: number;
|
|
97
|
+
};
|
|
98
|
+
completion_tokens_details?: {
|
|
99
|
+
reasoning_tokens?: number;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
export type OpenAICompatChatChoiceMessage = {
|
|
103
|
+
role: "assistant";
|
|
104
|
+
content?: string | null;
|
|
105
|
+
tool_calls?: OpenAICompatToolCallWire[];
|
|
106
|
+
refusal?: string | null;
|
|
107
|
+
};
|
|
108
|
+
export type OpenAICompatChatChoice = {
|
|
109
|
+
index: number;
|
|
110
|
+
message: OpenAICompatChatChoiceMessage;
|
|
111
|
+
finish_reason: "stop" | "length" | "tool_calls" | "function_call" | "content_filter" | null;
|
|
112
|
+
};
|
|
113
|
+
export type OpenAICompatChatResponse = {
|
|
114
|
+
id?: string;
|
|
115
|
+
object?: string;
|
|
116
|
+
created?: number;
|
|
117
|
+
model?: string;
|
|
118
|
+
choices: OpenAICompatChatChoice[];
|
|
119
|
+
usage?: OpenAICompatUsage;
|
|
120
|
+
system_fingerprint?: string;
|
|
121
|
+
};
|
|
122
|
+
export type OpenAICompatStreamDelta = {
|
|
123
|
+
role?: OpenAICompatChatRole;
|
|
124
|
+
content?: string | null;
|
|
125
|
+
tool_calls?: Array<{
|
|
126
|
+
index: number;
|
|
127
|
+
id?: string;
|
|
128
|
+
type?: "function";
|
|
129
|
+
function?: {
|
|
130
|
+
name?: string;
|
|
131
|
+
arguments?: string;
|
|
132
|
+
};
|
|
133
|
+
}>;
|
|
134
|
+
refusal?: string | null;
|
|
135
|
+
};
|
|
136
|
+
export type OpenAICompatStreamChunkChoice = {
|
|
137
|
+
index: number;
|
|
138
|
+
delta: OpenAICompatStreamDelta;
|
|
139
|
+
finish_reason: "stop" | "length" | "tool_calls" | "function_call" | "content_filter" | null;
|
|
140
|
+
};
|
|
141
|
+
export type OpenAICompatChatStreamChunk = {
|
|
142
|
+
id?: string;
|
|
143
|
+
object?: string;
|
|
144
|
+
created?: number;
|
|
145
|
+
model?: string;
|
|
146
|
+
choices: OpenAICompatStreamChunkChoice[];
|
|
147
|
+
usage?: OpenAICompatUsage;
|
|
148
|
+
};
|
|
149
|
+
export type OpenAICompatErrorBody = {
|
|
150
|
+
error?: {
|
|
151
|
+
message?: string;
|
|
152
|
+
type?: string;
|
|
153
|
+
code?: string | number;
|
|
154
|
+
param?: string | null;
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
export type OpenAICompatConfig = {
|
|
158
|
+
provider: string;
|
|
159
|
+
modelId: string;
|
|
160
|
+
baseURL: string;
|
|
161
|
+
apiKey?: string;
|
|
162
|
+
headers?: Record<string, string> | (() => Record<string, string>);
|
|
163
|
+
fetch?: typeof globalThis.fetch;
|
|
164
|
+
};
|
|
165
|
+
export type OpenAICompatToolWarning = NonNullable<Awaited<ReturnType<LanguageModelV3["doGenerate"]>>["warnings"]>[number];
|
|
166
|
+
export type OpenAICompatV3Content = Awaited<ReturnType<LanguageModelV3["doGenerate"]>>["content"][number];
|
|
167
|
+
export type OpenAICompatV3FinishReason = Awaited<ReturnType<LanguageModelV3["doGenerate"]>>["finishReason"];
|
|
168
|
+
export type OpenAICompatV3Usage = Awaited<ReturnType<LanguageModelV3["doGenerate"]>>["usage"];
|
|
169
|
+
export type OpenAICompatV3StreamPart = Awaited<ReturnType<LanguageModelV3["doStream"]>>["stream"] extends ReadableStream<infer P> ? P : never;
|
|
170
|
+
export type OpenAICompatV3CallTools = NonNullable<LanguageModelV3CallOptions["tools"]>;
|
|
171
|
+
export type OpenAICompatV3CallToolChoice = NonNullable<LanguageModelV3CallOptions["toolChoice"]>;
|
|
172
|
+
export type OpenAICompatUserOrAssistantPart = {
|
|
173
|
+
type: "text";
|
|
174
|
+
text: string;
|
|
175
|
+
} | {
|
|
176
|
+
type: "file";
|
|
177
|
+
mediaType: string;
|
|
178
|
+
data: Uint8Array | string | URL;
|
|
179
|
+
filename?: string;
|
|
180
|
+
};
|
|
181
|
+
export type OpenAICompatMessage = {
|
|
182
|
+
role: "system" | "user" | "assistant" | "tool";
|
|
183
|
+
content: unknown;
|
|
184
|
+
toolCallId?: string;
|
|
185
|
+
toolName?: string;
|
|
186
|
+
};
|
|
187
|
+
export type OpenAICompatSSEResult = {
|
|
188
|
+
text: string;
|
|
189
|
+
toolCalls: Map<number, {
|
|
190
|
+
id: string;
|
|
191
|
+
name: string;
|
|
192
|
+
argsBuffered: string;
|
|
193
|
+
}>;
|
|
194
|
+
finishReason: "stop" | "length" | "tool_calls" | "function_call" | "content_filter" | null;
|
|
195
|
+
usage?: OpenAICompatUsage;
|
|
196
|
+
};
|
|
197
|
+
export type OpenAICompatStreamChunk = {
|
|
198
|
+
content: string;
|
|
199
|
+
} | {
|
|
200
|
+
done: true;
|
|
201
|
+
};
|
|
202
|
+
export type ToolExecutionSummaryInternal = {
|
|
203
|
+
toolCallId: string;
|
|
204
|
+
toolName: string;
|
|
205
|
+
input: unknown;
|
|
206
|
+
output?: unknown;
|
|
207
|
+
error?: string;
|
|
208
|
+
startTime: Date;
|
|
209
|
+
endTime: Date;
|
|
210
|
+
};
|
|
211
|
+
export type StreamLoopArgs = {
|
|
212
|
+
maxSteps: number;
|
|
213
|
+
modelId: string;
|
|
214
|
+
url: string;
|
|
215
|
+
apiKey: string;
|
|
216
|
+
fetchImpl: typeof fetch;
|
|
217
|
+
abortSignal: AbortSignal | undefined;
|
|
218
|
+
options: StreamOptions;
|
|
219
|
+
conversation: OpenAICompatChatMessage[];
|
|
220
|
+
openAITools: OpenAICompatChatTool[] | undefined;
|
|
221
|
+
openAIToolChoice: OpenAICompatToolChoiceWire | undefined;
|
|
222
|
+
toolsRecord: Record<string, Tool>;
|
|
223
|
+
emitter: TypedEventEmitter<NeuroLinkEvents> | undefined;
|
|
224
|
+
toolsUsed: string[];
|
|
225
|
+
toolExecutionSummaries: ToolExecutionSummaryInternal[];
|
|
226
|
+
pushChunk: (chunk: OpenAICompatStreamChunk) => void;
|
|
227
|
+
resolveUsage: (u: {
|
|
228
|
+
promptTokens: number;
|
|
229
|
+
completionTokens: number;
|
|
230
|
+
totalTokens: number;
|
|
231
|
+
}) => void;
|
|
232
|
+
resolveFinish: (reason: string) => void;
|
|
233
|
+
};
|
|
234
|
+
export type OpenAICompatBuildBodyArgs = {
|
|
235
|
+
modelId: string;
|
|
236
|
+
messages: OpenAICompatChatMessage[];
|
|
237
|
+
options: {
|
|
238
|
+
maxTokens?: number | null;
|
|
239
|
+
temperature?: number | null;
|
|
240
|
+
topP?: number | null;
|
|
241
|
+
presencePenalty?: number | null;
|
|
242
|
+
frequencyPenalty?: number | null;
|
|
243
|
+
seed?: number | null;
|
|
244
|
+
stopSequences?: string[];
|
|
245
|
+
};
|
|
246
|
+
tools?: OpenAICompatChatTool[];
|
|
247
|
+
toolChoice?: OpenAICompatToolChoiceWire;
|
|
248
|
+
streaming: boolean;
|
|
249
|
+
responseFormat?: OpenAICompatResponseFormat;
|
|
250
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -903,6 +903,8 @@ export type AnthropicVertexSettings = {
|
|
|
903
903
|
projectId: string;
|
|
904
904
|
/** Google Cloud region for Anthropic models (e.g., 'us-east5') */
|
|
905
905
|
region: string;
|
|
906
|
+
/** SDK request timeout in milliseconds */
|
|
907
|
+
timeout?: number;
|
|
906
908
|
};
|
|
907
909
|
/**
|
|
908
910
|
* OpenAI-compatible models endpoint response structure
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juspay/neurolink",
|
|
3
|
-
"version": "9.67.
|
|
3
|
+
"version": "9.67.2",
|
|
4
4
|
"packageManager": "pnpm@10.15.1",
|
|
5
5
|
"description": "Universal AI Development Platform with working MCP integration, multi-provider support, voice (TTS/STT/realtime), and professional CLI. 58+ external MCP servers discoverable, multimodal file processing, RAG pipelines. Build, test, and deploy AI applications with 21+ providers: OpenAI, Anthropic, Google AI Studio, Google Vertex, AWS Bedrock, Azure OpenAI, Mistral, LiteLLM, SageMaker, Hugging Face, Ollama, OpenAI-compatible, OpenRouter, DeepSeek, NVIDIA NIM, LM Studio, llama.cpp, plus voice (OpenAI TTS, ElevenLabs, Deepgram, Azure Speech).",
|
|
6
6
|
"author": {
|
|
@@ -331,6 +331,7 @@
|
|
|
331
331
|
"croner": "^9.1.0",
|
|
332
332
|
"csv-parser": "^3.2.0",
|
|
333
333
|
"dotenv": "^17.3.1",
|
|
334
|
+
"eventsource-parser": "^3.0.8",
|
|
334
335
|
"google-auth-library": "^10.6.1",
|
|
335
336
|
"hono": "^4.12.3",
|
|
336
337
|
"inquirer": "^13.3.0",
|