@juspay/neurolink 9.68.2 → 9.68.3
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 +311 -311
- package/dist/lib/providers/fireworks.d.ts +9 -20
- package/dist/lib/providers/fireworks.js +31 -115
- package/dist/providers/fireworks.d.ts +9 -20
- package/dist/providers/fireworks.js +31 -115
- package/package.json +1 -1
|
@@ -1,33 +1,22 @@
|
|
|
1
1
|
import type { AIProviderName } from "../constants/enums.js";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import type { LanguageModel } from "../types/index.js";
|
|
2
|
+
import type { NeurolinkCredentials } from "../types/index.js";
|
|
3
|
+
import { OpenAIChatCompletionsProvider } from "./openaiChatCompletionsBase.js";
|
|
5
4
|
/**
|
|
6
|
-
* Fireworks AI Provider
|
|
5
|
+
* Fireworks AI Provider — direct HTTP, no AI SDK.
|
|
7
6
|
*
|
|
8
7
|
* Hosted open-model serving at api.fireworks.ai/inference/v1
|
|
9
8
|
* (OpenAI-compatible). Best for low-latency at scale on Llama / Mixtral /
|
|
10
|
-
* Qwen / DeepSeek.
|
|
9
|
+
* Qwen / DeepSeek. All request/stream/tool-loop orchestration lives in
|
|
10
|
+
* `OpenAIChatCompletionsProvider`; this class only declares configuration
|
|
11
|
+
* and provider-specific error mapping.
|
|
11
12
|
*
|
|
12
13
|
* @see https://docs.fireworks.ai/api-reference/introduction
|
|
13
14
|
*/
|
|
14
|
-
export declare class FireworksProvider extends
|
|
15
|
-
private model;
|
|
16
|
-
private apiKey;
|
|
17
|
-
private baseURL;
|
|
15
|
+
export declare class FireworksProvider extends OpenAIChatCompletionsProvider {
|
|
18
16
|
constructor(modelName?: string, sdk?: unknown, _region?: string, credentials?: NeurolinkCredentials["fireworks"]);
|
|
19
|
-
protected executeStream(options: StreamOptions, _analysisSchema?: ValidationSchema): Promise<StreamResult>;
|
|
20
|
-
private executeStreamInner;
|
|
21
17
|
protected getProviderName(): AIProviderName;
|
|
22
18
|
protected getDefaultModel(): string;
|
|
23
|
-
protected
|
|
19
|
+
protected getFallbackModelName(): string;
|
|
20
|
+
protected getFallbackModels(): string[];
|
|
24
21
|
protected formatProviderError(error: unknown): Error;
|
|
25
|
-
validateConfiguration(): Promise<boolean>;
|
|
26
|
-
getConfiguration(): {
|
|
27
|
-
provider: AIProviderName;
|
|
28
|
-
model: string;
|
|
29
|
-
defaultModel: string;
|
|
30
|
-
baseURL: string;
|
|
31
|
-
};
|
|
32
22
|
}
|
|
33
|
-
export default FireworksProvider;
|
|
@@ -1,132 +1,60 @@
|
|
|
1
|
-
import { createOpenAI } from "@ai-sdk/openai";
|
|
2
1
|
import { FireworksModels } from "../constants/enums.js";
|
|
3
|
-
import { BaseProvider } from "../core/baseProvider.js";
|
|
4
|
-
import { DEFAULT_MAX_STEPS } from "../core/constants.js";
|
|
5
|
-
import { streamAnalyticsCollector } from "../core/streamAnalytics.js";
|
|
6
|
-
import { isNeuroLink } from "../neurolink.js";
|
|
7
|
-
import { createLoggingFetch } from "../utils/loggingFetch.js";
|
|
8
|
-
import { tracers, ATTR, withClientStreamSpan } from "../telemetry/index.js";
|
|
9
2
|
import { AuthenticationError, InvalidModelError, NetworkError, ProviderError, RateLimitError, } from "../types/index.js";
|
|
10
3
|
import { logger } from "../utils/logger.js";
|
|
11
4
|
import { createFireworksConfig, getProviderModel, validateApiKey, } from "../utils/providerConfig.js";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { resolveToolChoice } from "../utils/toolChoice.js";
|
|
15
|
-
import { toAnalyticsStreamResult } from "./providerTypeUtils.js";
|
|
16
|
-
import { stepCountIs } from "../utils/tool.js";
|
|
17
|
-
import { streamText } from "../utils/generation.js";
|
|
5
|
+
import { TimeoutError } from "../utils/timeout.js";
|
|
6
|
+
import { OpenAIChatCompletionsProvider } from "./openaiChatCompletionsBase.js";
|
|
18
7
|
const FIREWORKS_DEFAULT_BASE_URL = "https://api.fireworks.ai/inference/v1";
|
|
19
8
|
const getFireworksApiKey = () => validateApiKey(createFireworksConfig());
|
|
20
9
|
const getDefaultFireworksModel = () => getProviderModel("FIREWORKS_MODEL", FireworksModels.DEEPSEEK_V4_PRO);
|
|
21
10
|
/**
|
|
22
|
-
* Fireworks AI Provider
|
|
11
|
+
* Fireworks AI Provider — direct HTTP, no AI SDK.
|
|
23
12
|
*
|
|
24
13
|
* Hosted open-model serving at api.fireworks.ai/inference/v1
|
|
25
14
|
* (OpenAI-compatible). Best for low-latency at scale on Llama / Mixtral /
|
|
26
|
-
* Qwen / DeepSeek.
|
|
15
|
+
* Qwen / DeepSeek. All request/stream/tool-loop orchestration lives in
|
|
16
|
+
* `OpenAIChatCompletionsProvider`; this class only declares configuration
|
|
17
|
+
* and provider-specific error mapping.
|
|
27
18
|
*
|
|
28
19
|
* @see https://docs.fireworks.ai/api-reference/introduction
|
|
29
20
|
*/
|
|
30
|
-
export class FireworksProvider extends
|
|
31
|
-
model;
|
|
32
|
-
apiKey;
|
|
33
|
-
baseURL;
|
|
21
|
+
export class FireworksProvider extends OpenAIChatCompletionsProvider {
|
|
34
22
|
constructor(modelName, sdk, _region, credentials) {
|
|
35
|
-
|
|
36
|
-
|
|
23
|
+
// Trim the override before applying precedence. A blank/whitespace
|
|
24
|
+
// `credentials.apiKey` must NOT bypass the env key — that would build a
|
|
25
|
+
// client with an unusable bearer token and fail at request time.
|
|
37
26
|
const overrideApiKey = credentials?.apiKey?.trim();
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
FIREWORKS_DEFAULT_BASE_URL;
|
|
46
|
-
const fireworks = createOpenAI({
|
|
47
|
-
apiKey: this.apiKey,
|
|
48
|
-
baseURL: this.baseURL,
|
|
49
|
-
fetch: createLoggingFetch("fireworks"),
|
|
50
|
-
});
|
|
51
|
-
this.model = fireworks.chat(this.modelName);
|
|
27
|
+
const apiKey = overrideApiKey && overrideApiKey.length > 0
|
|
28
|
+
? overrideApiKey
|
|
29
|
+
: getFireworksApiKey();
|
|
30
|
+
const baseURL = credentials?.baseURL?.trim() ||
|
|
31
|
+
process.env.FIREWORKS_BASE_URL?.trim() ||
|
|
32
|
+
FIREWORKS_DEFAULT_BASE_URL;
|
|
33
|
+
super("fireworks", modelName, sdk, { baseURL, apiKey });
|
|
52
34
|
logger.debug("Fireworks Provider initialized", {
|
|
53
35
|
modelName: this.modelName,
|
|
54
36
|
providerName: this.providerName,
|
|
55
|
-
baseURL: this.baseURL,
|
|
37
|
+
baseURL: this.config.baseURL,
|
|
56
38
|
});
|
|
57
39
|
}
|
|
58
|
-
async executeStream(options, _analysisSchema) {
|
|
59
|
-
return withClientStreamSpan({
|
|
60
|
-
name: "neurolink.provider.stream",
|
|
61
|
-
tracer: tracers.provider,
|
|
62
|
-
attributes: {
|
|
63
|
-
[ATTR.GEN_AI_SYSTEM]: "fireworks",
|
|
64
|
-
[ATTR.GEN_AI_MODEL]: this.modelName,
|
|
65
|
-
[ATTR.GEN_AI_OPERATION]: "stream",
|
|
66
|
-
[ATTR.NL_STREAM_MODE]: true,
|
|
67
|
-
},
|
|
68
|
-
}, async () => this.executeStreamInner(options), (r) => r.stream, (r, wrapped) => ({ ...r, stream: wrapped }));
|
|
69
|
-
}
|
|
70
|
-
async executeStreamInner(options) {
|
|
71
|
-
this.validateStreamOptions(options);
|
|
72
|
-
const startTime = Date.now();
|
|
73
|
-
const timeout = this.getTimeout(options);
|
|
74
|
-
const timeoutController = createTimeoutController(timeout, this.providerName, "stream");
|
|
75
|
-
try {
|
|
76
|
-
const shouldUseTools = !options.disableTools && this.supportsTools();
|
|
77
|
-
const tools = shouldUseTools
|
|
78
|
-
? options.tools || (await this.getAllTools())
|
|
79
|
-
: {};
|
|
80
|
-
const messages = await this.buildMessagesForStream(options);
|
|
81
|
-
const model = await this.getAISDKModelWithMiddleware(options);
|
|
82
|
-
const result = await streamText({
|
|
83
|
-
model,
|
|
84
|
-
messages,
|
|
85
|
-
temperature: options.temperature,
|
|
86
|
-
maxOutputTokens: options.maxTokens,
|
|
87
|
-
tools,
|
|
88
|
-
stopWhen: stepCountIs(options.maxSteps || DEFAULT_MAX_STEPS),
|
|
89
|
-
toolChoice: resolveToolChoice(options, tools, shouldUseTools),
|
|
90
|
-
abortSignal: composeAbortSignals(options.abortSignal, timeoutController?.controller.signal),
|
|
91
|
-
experimental_telemetry: this.telemetryHandler.getTelemetryConfig(options),
|
|
92
|
-
experimental_repairToolCall: this.getToolCallRepairFn(options),
|
|
93
|
-
onStepFinish: ({ toolCalls, toolResults }) => {
|
|
94
|
-
emitToolEndFromStepFinish(this.neurolink?.getEventEmitter(), toolResults);
|
|
95
|
-
this.handleToolExecutionStorage(toolCalls, toolResults, options, new Date()).catch((error) => {
|
|
96
|
-
logger.warn("[FireworksProvider] Failed to store tool executions", {
|
|
97
|
-
provider: this.providerName,
|
|
98
|
-
error: error instanceof Error ? error.message : String(error),
|
|
99
|
-
});
|
|
100
|
-
});
|
|
101
|
-
},
|
|
102
|
-
});
|
|
103
|
-
timeoutController?.cleanup();
|
|
104
|
-
const transformedStream = this.createTextStream(result);
|
|
105
|
-
const analyticsPromise = streamAnalyticsCollector.createAnalytics(this.providerName, this.modelName, toAnalyticsStreamResult(result), Date.now() - startTime, {
|
|
106
|
-
requestId: `fireworks-stream-${Date.now()}`,
|
|
107
|
-
streamingMode: true,
|
|
108
|
-
});
|
|
109
|
-
return {
|
|
110
|
-
stream: transformedStream,
|
|
111
|
-
provider: this.providerName,
|
|
112
|
-
model: this.modelName,
|
|
113
|
-
analytics: analyticsPromise,
|
|
114
|
-
metadata: { startTime, streamId: `fireworks-${Date.now()}` },
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
catch (error) {
|
|
118
|
-
timeoutController?.cleanup();
|
|
119
|
-
throw this.handleProviderError(error);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
40
|
getProviderName() {
|
|
123
|
-
return
|
|
41
|
+
return "fireworks";
|
|
124
42
|
}
|
|
125
43
|
getDefaultModel() {
|
|
126
44
|
return getDefaultFireworksModel();
|
|
127
45
|
}
|
|
128
|
-
|
|
129
|
-
return
|
|
46
|
+
getFallbackModelName() {
|
|
47
|
+
return FireworksModels.DEEPSEEK_V4_PRO;
|
|
48
|
+
}
|
|
49
|
+
getFallbackModels() {
|
|
50
|
+
return [
|
|
51
|
+
FireworksModels.DEEPSEEK_V4_PRO,
|
|
52
|
+
FireworksModels.GLM_5P1,
|
|
53
|
+
FireworksModels.GLM_5,
|
|
54
|
+
FireworksModels.KIMI_K2P6,
|
|
55
|
+
FireworksModels.KIMI_K2P5,
|
|
56
|
+
FireworksModels.GPT_OSS_120B,
|
|
57
|
+
];
|
|
130
58
|
}
|
|
131
59
|
formatProviderError(error) {
|
|
132
60
|
if (error instanceof TimeoutError) {
|
|
@@ -149,17 +77,5 @@ export class FireworksProvider extends BaseProvider {
|
|
|
149
77
|
}
|
|
150
78
|
return new ProviderError(`Fireworks error: ${message}`, "fireworks");
|
|
151
79
|
}
|
|
152
|
-
async validateConfiguration() {
|
|
153
|
-
return typeof this.apiKey === "string" && this.apiKey.trim().length > 0;
|
|
154
|
-
}
|
|
155
|
-
getConfiguration() {
|
|
156
|
-
return {
|
|
157
|
-
provider: this.providerName,
|
|
158
|
-
model: this.modelName,
|
|
159
|
-
defaultModel: getDefaultFireworksModel(),
|
|
160
|
-
baseURL: this.baseURL,
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
80
|
}
|
|
164
|
-
export default FireworksProvider;
|
|
165
81
|
//# sourceMappingURL=fireworks.js.map
|
|
@@ -1,33 +1,22 @@
|
|
|
1
1
|
import type { AIProviderName } from "../constants/enums.js";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import type { LanguageModel } from "../types/index.js";
|
|
2
|
+
import type { NeurolinkCredentials } from "../types/index.js";
|
|
3
|
+
import { OpenAIChatCompletionsProvider } from "./openaiChatCompletionsBase.js";
|
|
5
4
|
/**
|
|
6
|
-
* Fireworks AI Provider
|
|
5
|
+
* Fireworks AI Provider — direct HTTP, no AI SDK.
|
|
7
6
|
*
|
|
8
7
|
* Hosted open-model serving at api.fireworks.ai/inference/v1
|
|
9
8
|
* (OpenAI-compatible). Best for low-latency at scale on Llama / Mixtral /
|
|
10
|
-
* Qwen / DeepSeek.
|
|
9
|
+
* Qwen / DeepSeek. All request/stream/tool-loop orchestration lives in
|
|
10
|
+
* `OpenAIChatCompletionsProvider`; this class only declares configuration
|
|
11
|
+
* and provider-specific error mapping.
|
|
11
12
|
*
|
|
12
13
|
* @see https://docs.fireworks.ai/api-reference/introduction
|
|
13
14
|
*/
|
|
14
|
-
export declare class FireworksProvider extends
|
|
15
|
-
private model;
|
|
16
|
-
private apiKey;
|
|
17
|
-
private baseURL;
|
|
15
|
+
export declare class FireworksProvider extends OpenAIChatCompletionsProvider {
|
|
18
16
|
constructor(modelName?: string, sdk?: unknown, _region?: string, credentials?: NeurolinkCredentials["fireworks"]);
|
|
19
|
-
protected executeStream(options: StreamOptions, _analysisSchema?: ValidationSchema): Promise<StreamResult>;
|
|
20
|
-
private executeStreamInner;
|
|
21
17
|
protected getProviderName(): AIProviderName;
|
|
22
18
|
protected getDefaultModel(): string;
|
|
23
|
-
protected
|
|
19
|
+
protected getFallbackModelName(): string;
|
|
20
|
+
protected getFallbackModels(): string[];
|
|
24
21
|
protected formatProviderError(error: unknown): Error;
|
|
25
|
-
validateConfiguration(): Promise<boolean>;
|
|
26
|
-
getConfiguration(): {
|
|
27
|
-
provider: AIProviderName;
|
|
28
|
-
model: string;
|
|
29
|
-
defaultModel: string;
|
|
30
|
-
baseURL: string;
|
|
31
|
-
};
|
|
32
22
|
}
|
|
33
|
-
export default FireworksProvider;
|
|
@@ -1,132 +1,60 @@
|
|
|
1
|
-
import { createOpenAI } from "@ai-sdk/openai";
|
|
2
1
|
import { FireworksModels } from "../constants/enums.js";
|
|
3
|
-
import { BaseProvider } from "../core/baseProvider.js";
|
|
4
|
-
import { DEFAULT_MAX_STEPS } from "../core/constants.js";
|
|
5
|
-
import { streamAnalyticsCollector } from "../core/streamAnalytics.js";
|
|
6
|
-
import { isNeuroLink } from "../neurolink.js";
|
|
7
|
-
import { createLoggingFetch } from "../utils/loggingFetch.js";
|
|
8
|
-
import { tracers, ATTR, withClientStreamSpan } from "../telemetry/index.js";
|
|
9
2
|
import { AuthenticationError, InvalidModelError, NetworkError, ProviderError, RateLimitError, } from "../types/index.js";
|
|
10
3
|
import { logger } from "../utils/logger.js";
|
|
11
4
|
import { createFireworksConfig, getProviderModel, validateApiKey, } from "../utils/providerConfig.js";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { resolveToolChoice } from "../utils/toolChoice.js";
|
|
15
|
-
import { toAnalyticsStreamResult } from "./providerTypeUtils.js";
|
|
16
|
-
import { stepCountIs } from "../utils/tool.js";
|
|
17
|
-
import { streamText } from "../utils/generation.js";
|
|
5
|
+
import { TimeoutError } from "../utils/timeout.js";
|
|
6
|
+
import { OpenAIChatCompletionsProvider } from "./openaiChatCompletionsBase.js";
|
|
18
7
|
const FIREWORKS_DEFAULT_BASE_URL = "https://api.fireworks.ai/inference/v1";
|
|
19
8
|
const getFireworksApiKey = () => validateApiKey(createFireworksConfig());
|
|
20
9
|
const getDefaultFireworksModel = () => getProviderModel("FIREWORKS_MODEL", FireworksModels.DEEPSEEK_V4_PRO);
|
|
21
10
|
/**
|
|
22
|
-
* Fireworks AI Provider
|
|
11
|
+
* Fireworks AI Provider — direct HTTP, no AI SDK.
|
|
23
12
|
*
|
|
24
13
|
* Hosted open-model serving at api.fireworks.ai/inference/v1
|
|
25
14
|
* (OpenAI-compatible). Best for low-latency at scale on Llama / Mixtral /
|
|
26
|
-
* Qwen / DeepSeek.
|
|
15
|
+
* Qwen / DeepSeek. All request/stream/tool-loop orchestration lives in
|
|
16
|
+
* `OpenAIChatCompletionsProvider`; this class only declares configuration
|
|
17
|
+
* and provider-specific error mapping.
|
|
27
18
|
*
|
|
28
19
|
* @see https://docs.fireworks.ai/api-reference/introduction
|
|
29
20
|
*/
|
|
30
|
-
export class FireworksProvider extends
|
|
31
|
-
model;
|
|
32
|
-
apiKey;
|
|
33
|
-
baseURL;
|
|
21
|
+
export class FireworksProvider extends OpenAIChatCompletionsProvider {
|
|
34
22
|
constructor(modelName, sdk, _region, credentials) {
|
|
35
|
-
|
|
36
|
-
|
|
23
|
+
// Trim the override before applying precedence. A blank/whitespace
|
|
24
|
+
// `credentials.apiKey` must NOT bypass the env key — that would build a
|
|
25
|
+
// client with an unusable bearer token and fail at request time.
|
|
37
26
|
const overrideApiKey = credentials?.apiKey?.trim();
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
FIREWORKS_DEFAULT_BASE_URL;
|
|
46
|
-
const fireworks = createOpenAI({
|
|
47
|
-
apiKey: this.apiKey,
|
|
48
|
-
baseURL: this.baseURL,
|
|
49
|
-
fetch: createLoggingFetch("fireworks"),
|
|
50
|
-
});
|
|
51
|
-
this.model = fireworks.chat(this.modelName);
|
|
27
|
+
const apiKey = overrideApiKey && overrideApiKey.length > 0
|
|
28
|
+
? overrideApiKey
|
|
29
|
+
: getFireworksApiKey();
|
|
30
|
+
const baseURL = credentials?.baseURL?.trim() ||
|
|
31
|
+
process.env.FIREWORKS_BASE_URL?.trim() ||
|
|
32
|
+
FIREWORKS_DEFAULT_BASE_URL;
|
|
33
|
+
super("fireworks", modelName, sdk, { baseURL, apiKey });
|
|
52
34
|
logger.debug("Fireworks Provider initialized", {
|
|
53
35
|
modelName: this.modelName,
|
|
54
36
|
providerName: this.providerName,
|
|
55
|
-
baseURL: this.baseURL,
|
|
37
|
+
baseURL: this.config.baseURL,
|
|
56
38
|
});
|
|
57
39
|
}
|
|
58
|
-
async executeStream(options, _analysisSchema) {
|
|
59
|
-
return withClientStreamSpan({
|
|
60
|
-
name: "neurolink.provider.stream",
|
|
61
|
-
tracer: tracers.provider,
|
|
62
|
-
attributes: {
|
|
63
|
-
[ATTR.GEN_AI_SYSTEM]: "fireworks",
|
|
64
|
-
[ATTR.GEN_AI_MODEL]: this.modelName,
|
|
65
|
-
[ATTR.GEN_AI_OPERATION]: "stream",
|
|
66
|
-
[ATTR.NL_STREAM_MODE]: true,
|
|
67
|
-
},
|
|
68
|
-
}, async () => this.executeStreamInner(options), (r) => r.stream, (r, wrapped) => ({ ...r, stream: wrapped }));
|
|
69
|
-
}
|
|
70
|
-
async executeStreamInner(options) {
|
|
71
|
-
this.validateStreamOptions(options);
|
|
72
|
-
const startTime = Date.now();
|
|
73
|
-
const timeout = this.getTimeout(options);
|
|
74
|
-
const timeoutController = createTimeoutController(timeout, this.providerName, "stream");
|
|
75
|
-
try {
|
|
76
|
-
const shouldUseTools = !options.disableTools && this.supportsTools();
|
|
77
|
-
const tools = shouldUseTools
|
|
78
|
-
? options.tools || (await this.getAllTools())
|
|
79
|
-
: {};
|
|
80
|
-
const messages = await this.buildMessagesForStream(options);
|
|
81
|
-
const model = await this.getAISDKModelWithMiddleware(options);
|
|
82
|
-
const result = await streamText({
|
|
83
|
-
model,
|
|
84
|
-
messages,
|
|
85
|
-
temperature: options.temperature,
|
|
86
|
-
maxOutputTokens: options.maxTokens,
|
|
87
|
-
tools,
|
|
88
|
-
stopWhen: stepCountIs(options.maxSteps || DEFAULT_MAX_STEPS),
|
|
89
|
-
toolChoice: resolveToolChoice(options, tools, shouldUseTools),
|
|
90
|
-
abortSignal: composeAbortSignals(options.abortSignal, timeoutController?.controller.signal),
|
|
91
|
-
experimental_telemetry: this.telemetryHandler.getTelemetryConfig(options),
|
|
92
|
-
experimental_repairToolCall: this.getToolCallRepairFn(options),
|
|
93
|
-
onStepFinish: ({ toolCalls, toolResults }) => {
|
|
94
|
-
emitToolEndFromStepFinish(this.neurolink?.getEventEmitter(), toolResults);
|
|
95
|
-
this.handleToolExecutionStorage(toolCalls, toolResults, options, new Date()).catch((error) => {
|
|
96
|
-
logger.warn("[FireworksProvider] Failed to store tool executions", {
|
|
97
|
-
provider: this.providerName,
|
|
98
|
-
error: error instanceof Error ? error.message : String(error),
|
|
99
|
-
});
|
|
100
|
-
});
|
|
101
|
-
},
|
|
102
|
-
});
|
|
103
|
-
timeoutController?.cleanup();
|
|
104
|
-
const transformedStream = this.createTextStream(result);
|
|
105
|
-
const analyticsPromise = streamAnalyticsCollector.createAnalytics(this.providerName, this.modelName, toAnalyticsStreamResult(result), Date.now() - startTime, {
|
|
106
|
-
requestId: `fireworks-stream-${Date.now()}`,
|
|
107
|
-
streamingMode: true,
|
|
108
|
-
});
|
|
109
|
-
return {
|
|
110
|
-
stream: transformedStream,
|
|
111
|
-
provider: this.providerName,
|
|
112
|
-
model: this.modelName,
|
|
113
|
-
analytics: analyticsPromise,
|
|
114
|
-
metadata: { startTime, streamId: `fireworks-${Date.now()}` },
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
catch (error) {
|
|
118
|
-
timeoutController?.cleanup();
|
|
119
|
-
throw this.handleProviderError(error);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
40
|
getProviderName() {
|
|
123
|
-
return
|
|
41
|
+
return "fireworks";
|
|
124
42
|
}
|
|
125
43
|
getDefaultModel() {
|
|
126
44
|
return getDefaultFireworksModel();
|
|
127
45
|
}
|
|
128
|
-
|
|
129
|
-
return
|
|
46
|
+
getFallbackModelName() {
|
|
47
|
+
return FireworksModels.DEEPSEEK_V4_PRO;
|
|
48
|
+
}
|
|
49
|
+
getFallbackModels() {
|
|
50
|
+
return [
|
|
51
|
+
FireworksModels.DEEPSEEK_V4_PRO,
|
|
52
|
+
FireworksModels.GLM_5P1,
|
|
53
|
+
FireworksModels.GLM_5,
|
|
54
|
+
FireworksModels.KIMI_K2P6,
|
|
55
|
+
FireworksModels.KIMI_K2P5,
|
|
56
|
+
FireworksModels.GPT_OSS_120B,
|
|
57
|
+
];
|
|
130
58
|
}
|
|
131
59
|
formatProviderError(error) {
|
|
132
60
|
if (error instanceof TimeoutError) {
|
|
@@ -149,16 +77,4 @@ export class FireworksProvider extends BaseProvider {
|
|
|
149
77
|
}
|
|
150
78
|
return new ProviderError(`Fireworks error: ${message}`, "fireworks");
|
|
151
79
|
}
|
|
152
|
-
async validateConfiguration() {
|
|
153
|
-
return typeof this.apiKey === "string" && this.apiKey.trim().length > 0;
|
|
154
|
-
}
|
|
155
|
-
getConfiguration() {
|
|
156
|
-
return {
|
|
157
|
-
provider: this.providerName,
|
|
158
|
-
model: this.modelName,
|
|
159
|
-
defaultModel: getDefaultFireworksModel(),
|
|
160
|
-
baseURL: this.baseURL,
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
80
|
}
|
|
164
|
-
export default FireworksProvider;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juspay/neurolink",
|
|
3
|
-
"version": "9.68.
|
|
3
|
+
"version": "9.68.3",
|
|
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": {
|