@juspay/neurolink 9.68.9 → 9.68.11

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.
@@ -1,79 +1,31 @@
1
- import type { ZodType } from "zod";
2
1
  import type { AIProviderName } from "../constants/enums.js";
3
- import { BaseProvider } from "../core/baseProvider.js";
4
- import type { NeurolinkCredentials, StreamOptions, StreamResult } from "../types/index.js";
5
- import type { LanguageModel, Schema } from "../types/index.js";
2
+ import type { NeurolinkCredentials } from "../types/index.js";
3
+ import { OpenAIChatCompletionsProvider } from "./openaiChatCompletionsBase.js";
6
4
  /**
7
- * HuggingFace Provider - BaseProvider Implementation
8
- * Using AI SDK with HuggingFace's OpenAI-compatible endpoint
5
+ * HuggingFace Provider direct HTTP, no AI SDK.
6
+ *
7
+ * OpenAI-compatible chat completions at router.huggingface.co/v1 (unified
8
+ * router endpoint, 2025). Supports the full HuggingFace model hub including
9
+ * Llama 3.x, Qwen 2.5, Mistral, DeepSeek, and tool-calling capable variants.
10
+ * All request/stream/tool-loop orchestration lives in
11
+ * `OpenAIChatCompletionsProvider`; this class only declares configuration
12
+ * and provider-specific error mapping.
13
+ *
14
+ * @see https://huggingface.co/docs/api-inference/index
9
15
  */
10
- export declare class HuggingFaceProvider extends BaseProvider {
11
- private model;
12
- constructor(modelName?: string, _sdk?: unknown, credentials?: NeurolinkCredentials["huggingFace"]);
16
+ export declare class HuggingFaceProvider extends OpenAIChatCompletionsProvider {
17
+ constructor(modelName?: string, sdk?: unknown, credentials?: NeurolinkCredentials["huggingFace"]);
18
+ protected getProviderName(): AIProviderName;
19
+ protected getDefaultModel(): string;
20
+ protected getFallbackModelName(): string;
13
21
  /**
14
- * HuggingFace Tool Calling Support (Enhanced 2025)
15
- *
16
- * **Supported Models (Tool Calling Enabled):**
17
- * - meta-llama/Llama-3.1-8B-Instruct - Post-trained for tool calling
18
- * - meta-llama/Llama-3.1-70B-Instruct - Advanced tool calling capabilities
19
- * - meta-llama/Llama-3.1-405B-Instruct - Full tool calling support
20
- * - nvidia/Llama-3.1-Nemotron-Ultra-253B-v1 - Optimized for tool calling
21
- * - NousResearch/Hermes-3-Llama-3.2-3B - Function calling trained
22
- * - codellama/CodeLlama-34b-Instruct-hf - Code-focused tool calling
23
- * - mistralai/Mistral-7B-Instruct-v0.3 - Basic tool support
24
- *
25
- * **Unsupported Models (Tool Calling Disabled):**
26
- * - microsoft/DialoGPT-* - Treats tools as conversation context
27
- * - gpt2, bert, roberta variants - No tool calling training
28
- * - Most pre-2024 models - Limited function calling capabilities
29
- *
30
- * **Implementation Details:**
31
- * - Intelligent model detection based on known capabilities
32
- * - Custom tool schema formatting for HuggingFace models
33
- * - Enhanced response parsing for function call extraction
34
- * - Graceful fallback for unsupported models
35
- *
36
- * @returns true for supported models, false for unsupported models
22
+ * HuggingFace serves a huge variety of models, many of which reject the
23
+ * OpenAI `tools` field. The base reports supportsTools() === true
24
+ * unconditionally, which would merge tools into requests for models
25
+ * (including the default DialoGPT-medium) that don't accept them. Preserve
26
+ * the pre-migration allowlist: only known tool-calling-capable model
27
+ * families opt in; everything else runs tool-free.
37
28
  */
38
29
  supportsTools(): boolean;
39
- protected executeStream(options: StreamOptions, analysisSchema?: ZodType | Schema<unknown>): Promise<StreamResult>;
40
- /**
41
- * Prepare stream options with HuggingFace-specific enhancements
42
- * Handles tool calling optimizations and model-specific formatting
43
- */
44
- private prepareStreamOptions;
45
- /**
46
- * Enhance system prompt with tool calling instructions for HuggingFace models
47
- * Many HF models benefit from explicit tool calling guidance
48
- */
49
- private enhanceSystemPromptForTools;
50
- /**
51
- * Format tools for HuggingFace model compatibility
52
- * Some models require specific tool schema formatting
53
- */
54
- private formatToolsForHuggingFace;
55
- /**
56
- * Get recommendations for tool-calling capable HuggingFace models
57
- * Provides guidance for users who want to use function calling
58
- */
59
- static getToolCallingRecommendations(): {
60
- recommended: string[];
61
- performance: Record<string, {
62
- speed: number;
63
- quality: number;
64
- cost: number;
65
- }>;
66
- notes: Record<string, string>;
67
- };
68
- /**
69
- * Enhanced error handling with HuggingFace-specific guidance
70
- */
71
- formatProviderError(error: unknown): Error;
72
- getProviderName(): AIProviderName;
73
- getDefaultModel(): string;
74
- /**
75
- * Returns the Vercel AI SDK model instance for HuggingFace
76
- */
77
- getAISDKModel(): LanguageModel;
30
+ protected formatProviderError(error: unknown): Error;
78
31
  }
79
- export default HuggingFaceProvider;
@@ -1,311 +1,77 @@
1
- import { createOpenAI } from "@ai-sdk/openai";
2
- import { BaseProvider } from "../core/baseProvider.js";
3
- import { DEFAULT_MAX_STEPS } from "../core/constants.js";
4
- import { createProxyFetch } from "../proxy/proxyFetch.js";
5
1
  import { AuthenticationError, InvalidModelError, NetworkError, ProviderError, RateLimitError, } from "../types/index.js";
6
- import { emitToolEndFromStepFinish } from "../utils/toolEndEmitter.js";
7
2
  import { logger } from "../utils/logger.js";
8
- import { buildNoOutputSentinel, detectPostStreamNoOutput, stampNoOutputSpan, } from "../utils/noOutputSentinel.js";
9
3
  import { createHuggingFaceConfig, getProviderModel, validateApiKey, } from "../utils/providerConfig.js";
10
- import { composeAbortSignals, createTimeoutController, TimeoutError, } from "../utils/timeout.js";
11
- import { resolveToolChoice } from "../utils/toolChoice.js";
12
- import { NoOutputGeneratedError } from "../utils/generationErrors.js";
13
- import { stepCountIs } from "../utils/tool.js";
14
- import { streamText } from "../utils/generation.js";
15
- // Configuration helpers - now using consolidated utility
16
- const getHuggingFaceApiKey = () => {
17
- return validateApiKey(createHuggingFaceConfig());
18
- };
19
- const getDefaultHuggingFaceModel = () => {
20
- return getProviderModel("HUGGINGFACE_MODEL", "microsoft/DialoGPT-medium");
21
- };
22
- // Note: hasNeurolinkCredentials["huggingFace"] now directly imported from consolidated utility
4
+ import { TimeoutError } from "../utils/timeout.js";
5
+ import { OpenAIChatCompletionsProvider } from "./openaiChatCompletionsBase.js";
6
+ const HUGGINGFACE_DEFAULT_BASE_URL = "https://router.huggingface.co/v1";
7
+ const getHuggingFaceApiKey = () => validateApiKey(createHuggingFaceConfig());
8
+ const getDefaultHuggingFaceModel = () => getProviderModel("HUGGINGFACE_MODEL", "microsoft/DialoGPT-medium");
23
9
  /**
24
- * HuggingFace Provider - BaseProvider Implementation
25
- * Using AI SDK with HuggingFace's OpenAI-compatible endpoint
10
+ * HuggingFace Provider direct HTTP, no AI SDK.
11
+ *
12
+ * OpenAI-compatible chat completions at router.huggingface.co/v1 (unified
13
+ * router endpoint, 2025). Supports the full HuggingFace model hub including
14
+ * Llama 3.x, Qwen 2.5, Mistral, DeepSeek, and tool-calling capable variants.
15
+ * All request/stream/tool-loop orchestration lives in
16
+ * `OpenAIChatCompletionsProvider`; this class only declares configuration
17
+ * and provider-specific error mapping.
18
+ *
19
+ * @see https://huggingface.co/docs/api-inference/index
26
20
  */
27
- export class HuggingFaceProvider extends BaseProvider {
28
- model;
29
- constructor(modelName, _sdk, credentials) {
30
- super(modelName, "huggingface");
31
- // Get API key and validate
32
- const apiKey = credentials?.apiKey ?? getHuggingFaceApiKey();
33
- // Create HuggingFace provider using unified router endpoint (2025) with proxy support
34
- const huggingface = createOpenAI({
35
- apiKey: apiKey,
36
- baseURL: credentials?.baseURL ?? "https://router.huggingface.co/v1",
37
- fetch: createProxyFetch(),
38
- });
39
- // Initialize model
40
- this.model = huggingface(this.modelName);
21
+ export class HuggingFaceProvider extends OpenAIChatCompletionsProvider {
22
+ constructor(modelName, sdk, credentials) {
23
+ const apiKey = credentials?.apiKey?.trim()
24
+ ? credentials.apiKey.trim()
25
+ : getHuggingFaceApiKey();
26
+ // Treat blank/whitespace overrides as unset so an empty
27
+ // `credentials.baseURL` or `HUGGINGFACE_BASE_URL=` cannot override the
28
+ // default with "" (mirrors the apiKey precedence above).
29
+ const baseURL = credentials?.baseURL?.trim() ||
30
+ process.env.HUGGINGFACE_BASE_URL?.trim() ||
31
+ HUGGINGFACE_DEFAULT_BASE_URL;
32
+ super("huggingface", modelName, sdk, { baseURL, apiKey });
41
33
  logger.debug("HuggingFaceProvider initialized", {
42
- model: this.modelName,
43
- provider: this.providerName,
34
+ modelName: this.modelName,
35
+ providerName: this.providerName,
36
+ baseURL: this.config.baseURL,
44
37
  });
45
38
  }
46
- // ===================
47
- // ABSTRACT METHOD IMPLEMENTATIONS
48
- // ===================
39
+ getProviderName() {
40
+ return "huggingface";
41
+ }
42
+ getDefaultModel() {
43
+ return getDefaultHuggingFaceModel();
44
+ }
45
+ getFallbackModelName() {
46
+ return "meta-llama/Llama-3.1-8B-Instruct";
47
+ }
49
48
  /**
50
- * HuggingFace Tool Calling Support (Enhanced 2025)
51
- *
52
- * **Supported Models (Tool Calling Enabled):**
53
- * - meta-llama/Llama-3.1-8B-Instruct - Post-trained for tool calling
54
- * - meta-llama/Llama-3.1-70B-Instruct - Advanced tool calling capabilities
55
- * - meta-llama/Llama-3.1-405B-Instruct - Full tool calling support
56
- * - nvidia/Llama-3.1-Nemotron-Ultra-253B-v1 - Optimized for tool calling
57
- * - NousResearch/Hermes-3-Llama-3.2-3B - Function calling trained
58
- * - codellama/CodeLlama-34b-Instruct-hf - Code-focused tool calling
59
- * - mistralai/Mistral-7B-Instruct-v0.3 - Basic tool support
60
- *
61
- * **Unsupported Models (Tool Calling Disabled):**
62
- * - microsoft/DialoGPT-* - Treats tools as conversation context
63
- * - gpt2, bert, roberta variants - No tool calling training
64
- * - Most pre-2024 models - Limited function calling capabilities
65
- *
66
- * **Implementation Details:**
67
- * - Intelligent model detection based on known capabilities
68
- * - Custom tool schema formatting for HuggingFace models
69
- * - Enhanced response parsing for function call extraction
70
- * - Graceful fallback for unsupported models
71
- *
72
- * @returns true for supported models, false for unsupported models
49
+ * HuggingFace serves a huge variety of models, many of which reject the
50
+ * OpenAI `tools` field. The base reports supportsTools() === true
51
+ * unconditionally, which would merge tools into requests for models
52
+ * (including the default DialoGPT-medium) that don't accept them. Preserve
53
+ * the pre-migration allowlist: only known tool-calling-capable model
54
+ * families opt in; everything else runs tool-free.
73
55
  */
74
56
  supportsTools() {
75
57
  const modelName = this.modelName.toLowerCase();
76
- // Check if model is in the list of known tool-calling capable models
77
58
  const toolCapableModels = [
78
- // Llama 3.1 series (post-trained for tool calling)
79
59
  "llama-3.1-8b-instruct",
80
60
  "llama-3.1-70b-instruct",
81
61
  "llama-3.1-405b-instruct",
82
62
  "llama-3.1-nemotron-ultra",
83
- // Hermes series (function calling trained)
84
63
  "hermes-3-llama-3.2",
85
64
  "hermes-2-pro",
86
- // Code Llama (code-focused tool calling)
87
65
  "codellama-34b-instruct",
88
66
  "codellama-13b-instruct",
89
- // Mistral series (basic tool support)
90
67
  "mistral-7b-instruct-v0.3",
91
68
  "mistral-8x7b-instruct",
92
- // Other known tool-capable models
93
69
  "nous-hermes",
94
70
  "openchat",
95
71
  "wizardcoder",
96
72
  ];
97
- // Check if current model matches tool-capable model patterns
98
- const isToolCapable = toolCapableModels.some((capableModel) => modelName.includes(capableModel));
99
- if (isToolCapable) {
100
- logger.debug("HuggingFace tool calling enabled", {
101
- model: this.modelName,
102
- reason: "Model supports function calling",
103
- });
104
- return true;
105
- }
106
- // Log why tools are disabled for transparency
107
- logger.debug("HuggingFace tool calling disabled", {
108
- model: this.modelName,
109
- reason: "Model not in tool-capable list",
110
- suggestion: "Consider using Llama-3.1-* or Hermes-3-* models for tool calling",
111
- });
112
- return false;
113
- }
114
- // executeGenerate removed - BaseProvider handles all generation with tools
115
- async executeStream(options, analysisSchema) {
116
- this.validateStreamOptions(options);
117
- const timeout = this.getTimeout(options);
118
- const timeoutController = createTimeoutController(timeout, this.providerName, "stream");
119
- try {
120
- // Get tools - options.tools is pre-merged by BaseProvider.stream()
121
- const shouldUseTools = !options.disableTools && this.supportsTools();
122
- const allTools = shouldUseTools
123
- ? options.tools || (await this.getAllTools())
124
- : {};
125
- // Enhanced tool handling for HuggingFace models
126
- const streamOptions = this.prepareStreamOptions(options, analysisSchema);
127
- // Build message array from options with multimodal support
128
- // Using protected helper from BaseProvider to eliminate code duplication
129
- // Pass the enhanced system prompt (with tool-calling instructions) so it
130
- // actually reaches the model instead of being silently discarded.
131
- const messagesOptions = streamOptions.system
132
- ? { ...options, systemPrompt: streamOptions.system }
133
- : options;
134
- const messages = await this.buildMessagesForStream(messagesOptions);
135
- // Reviewer follow-up: capture upstream provider errors via onError
136
- // so the post-stream NoOutput detect can propagate the real cause
137
- // into the sentinel's providerError / modelResponseRaw.
138
- let capturedProviderError;
139
- const result = await streamText({
140
- model: this.model,
141
- messages: messages,
142
- temperature: options.temperature,
143
- maxOutputTokens: options.maxTokens, // No default limit - unlimited unless specified
144
- stopWhen: stepCountIs(options.maxSteps || DEFAULT_MAX_STEPS),
145
- tools: (shouldUseTools
146
- ? streamOptions.tools || allTools
147
- : {}),
148
- toolChoice: resolveToolChoice(options, (shouldUseTools ? streamOptions.tools || allTools : {}), shouldUseTools),
149
- abortSignal: composeAbortSignals(options.abortSignal, timeoutController?.controller.signal),
150
- experimental_telemetry: this.telemetryHandler.getTelemetryConfig(options),
151
- experimental_repairToolCall: this.getToolCallRepairFn(options),
152
- onError: (event) => {
153
- capturedProviderError = event.error;
154
- logger.error("HuggingFace: Stream error", {
155
- error: event.error instanceof Error
156
- ? event.error.message
157
- : String(event.error),
158
- });
159
- },
160
- onStepFinish: ({ toolCalls, toolResults }) => {
161
- emitToolEndFromStepFinish(this.neurolink?.getEventEmitter(), toolResults);
162
- this.handleToolExecutionStorage(toolCalls, toolResults, options, new Date()).catch((error) => {
163
- logger.warn("[HuggingFaceProvider] Failed to store tool executions", {
164
- provider: this.providerName,
165
- error: error instanceof Error ? error.message : String(error),
166
- });
167
- });
168
- },
169
- });
170
- timeoutController?.cleanup();
171
- // Transform stream to match StreamResult interface with enhanced tool call parsing
172
- const transformedStream = async function* () {
173
- let chunkCount = 0;
174
- try {
175
- for await (const chunk of result.textStream) {
176
- chunkCount++;
177
- yield { content: chunk };
178
- }
179
- }
180
- catch (streamError) {
181
- if (NoOutputGeneratedError.isInstance(streamError)) {
182
- logger.warn("HuggingFace: Stream produced no output (NoOutputGeneratedError) — caught from textStream");
183
- const sentinel = await buildNoOutputSentinel(streamError, result, capturedProviderError);
184
- stampNoOutputSpan(sentinel);
185
- yield sentinel;
186
- return;
187
- }
188
- throw streamError;
189
- }
190
- // Curator P3-6 (round-2 fix): production trigger comes through
191
- // the result.finishReason rejection, not textStream throws.
192
- if (chunkCount === 0) {
193
- const detected = await detectPostStreamNoOutput(result, capturedProviderError);
194
- if (detected) {
195
- logger.warn("HuggingFace: Stream produced no output (NoOutputGeneratedError) — caught from finishReason rejection");
196
- stampNoOutputSpan(detected.sentinel);
197
- yield detected.sentinel;
198
- }
199
- }
200
- };
201
- return {
202
- stream: transformedStream(),
203
- provider: this.providerName,
204
- model: this.modelName,
205
- };
206
- }
207
- catch (error) {
208
- timeoutController?.cleanup();
209
- throw this.handleProviderError(error);
210
- }
211
- }
212
- /**
213
- * Prepare stream options with HuggingFace-specific enhancements
214
- * Handles tool calling optimizations and model-specific formatting
215
- */
216
- prepareStreamOptions(options, _analysisSchema) {
217
- const modelSupportsTools = this.supportsTools();
218
- // If model doesn't support tools, disable them completely
219
- if (!modelSupportsTools) {
220
- return {
221
- prompt: options.input.text ?? "",
222
- system: options.systemPrompt,
223
- tools: undefined,
224
- toolChoice: undefined,
225
- };
226
- }
227
- // For tool-capable models, enhance the prompt with tool calling instructions
228
- const enhancedSystemPrompt = this.enhanceSystemPromptForTools(options.systemPrompt, options.tools);
229
- // Format tools using HuggingFace-compatible schema if tools are provided
230
- const formattedTools = options.tools
231
- ? this.formatToolsForHuggingFace(options.tools)
232
- : undefined;
233
- return {
234
- prompt: options.input.text ?? "",
235
- system: enhancedSystemPrompt,
236
- tools: formattedTools,
237
- toolChoice: formattedTools ? (options.toolChoice ?? "auto") : undefined,
238
- };
239
- }
240
- /**
241
- * Enhance system prompt with tool calling instructions for HuggingFace models
242
- * Many HF models benefit from explicit tool calling guidance
243
- */
244
- enhanceSystemPromptForTools(originalSystemPrompt, tools) {
245
- if (!tools || !this.supportsTools()) {
246
- return originalSystemPrompt || "";
247
- }
248
- const toolInstructions = `
249
- You have access to function tools. When you need to use a tool to answer the user's request:
250
- 1. Identify the appropriate tool from the available functions
251
- 2. Call the function with the correct parameters in JSON format
252
- 3. Use the function results to provide a comprehensive answer
253
-
254
- Available tools will be provided in the function calling format. Use them when they can help answer the user's question.
255
- `;
256
- return originalSystemPrompt
257
- ? `${originalSystemPrompt}\n\n${toolInstructions}`
258
- : toolInstructions;
259
- }
260
- /**
261
- * Format tools for HuggingFace model compatibility
262
- * Some models require specific tool schema formatting
263
- */
264
- formatToolsForHuggingFace(tools) {
265
- // For now, pass through tools as-is since we're using OpenAI-compatible endpoint
266
- // Future enhancement: Add model-specific tool formatting if needed
267
- return tools;
73
+ return toolCapableModels.some((capable) => modelName.includes(capable));
268
74
  }
269
- /**
270
- * Get recommendations for tool-calling capable HuggingFace models
271
- * Provides guidance for users who want to use function calling
272
- */
273
- static getToolCallingRecommendations() {
274
- return {
275
- recommended: [
276
- "meta-llama/Llama-3.1-8B-Instruct",
277
- "meta-llama/Llama-3.1-70B-Instruct",
278
- "nvidia/Llama-3.1-Nemotron-Ultra-253B-v1",
279
- "NousResearch/Hermes-3-Llama-3.2-3B",
280
- "codellama/CodeLlama-34b-Instruct-hf",
281
- ],
282
- performance: {
283
- "meta-llama/Llama-3.1-8B-Instruct": { speed: 3, quality: 2, cost: 3 },
284
- "meta-llama/Llama-3.1-70B-Instruct": { speed: 2, quality: 3, cost: 2 },
285
- "nvidia/Llama-3.1-Nemotron-Ultra-253B-v1": {
286
- speed: 2,
287
- quality: 3,
288
- cost: 1,
289
- },
290
- "NousResearch/Hermes-3-Llama-3.2-3B": { speed: 3, quality: 2, cost: 3 },
291
- "codellama/CodeLlama-34b-Instruct-hf": {
292
- speed: 2,
293
- quality: 3,
294
- cost: 2,
295
- },
296
- },
297
- notes: {
298
- "meta-llama/Llama-3.1-8B-Instruct": "Best balance of speed and tool calling capability",
299
- "meta-llama/Llama-3.1-70B-Instruct": "High-quality tool calling, slower inference",
300
- "nvidia/Llama-3.1-Nemotron-Ultra-253B-v1": "Optimized for tool calling, requires more resources",
301
- "NousResearch/Hermes-3-Llama-3.2-3B": "Lightweight with good tool calling support",
302
- "codellama/CodeLlama-34b-Instruct-hf": "Excellent for code-related tool calling",
303
- },
304
- };
305
- }
306
- /**
307
- * Enhanced error handling with HuggingFace-specific guidance
308
- */
309
75
  formatProviderError(error) {
310
76
  if (error instanceof TimeoutError) {
311
77
  return new NetworkError(`Request timed out: ${error.message}`, "huggingface");
@@ -330,19 +96,5 @@ Available tools will be provided in the function calling format. Use them when t
330
96
  }
331
97
  return new ProviderError(`HuggingFace Provider Error: ${message}`, "huggingface");
332
98
  }
333
- getProviderName() {
334
- return "huggingface";
335
- }
336
- getDefaultModel() {
337
- return getDefaultHuggingFaceModel();
338
- }
339
- /**
340
- * Returns the Vercel AI SDK model instance for HuggingFace
341
- */
342
- getAISDKModel() {
343
- return this.model;
344
- }
345
99
  }
346
- // Export for factory registration
347
- export default HuggingFaceProvider;
348
100
  //# sourceMappingURL=huggingFace.js.map
@@ -1,33 +1,23 @@
1
1
  import type { AIProviderName } from "../constants/enums.js";
2
- import { BaseProvider } from "../core/baseProvider.js";
3
- import type { NeurolinkCredentials, StreamOptions, StreamResult, ValidationSchema } from "../types/index.js";
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
- * Together AI Provider
5
+ * Together AI Provider — direct HTTP, no AI SDK.
7
6
  *
8
7
  * Hosted open-model gateway at api.together.xyz/v1 (OpenAI-compatible).
9
8
  * Llama / Mistral / Qwen / DeepSeek / Gemma / WizardLM available
10
9
  * server-less; pass any catalog id via `--model`.
10
+ * All request/stream/tool-loop orchestration lives in
11
+ * `OpenAIChatCompletionsProvider`; this class only declares configuration
12
+ * and provider-specific error mapping.
11
13
  *
12
14
  * @see https://docs.together.ai/docs/openai-api-compatibility
13
15
  */
14
- export declare class TogetherAIProvider extends BaseProvider {
15
- private model;
16
- private apiKey;
17
- private baseURL;
16
+ export declare class TogetherAIProvider extends OpenAIChatCompletionsProvider {
18
17
  constructor(modelName?: string, sdk?: unknown, _region?: string, credentials?: NeurolinkCredentials["together"]);
19
- protected executeStream(options: StreamOptions, _analysisSchema?: ValidationSchema): Promise<StreamResult>;
20
- private executeStreamInner;
21
18
  protected getProviderName(): AIProviderName;
22
19
  protected getDefaultModel(): string;
23
- protected getAISDKModel(): LanguageModel;
20
+ protected getFallbackModelName(): string;
21
+ protected getFallbackModels(): string[];
24
22
  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
23
  }
33
- export default TogetherAIProvider;