@infuro/cms-core 1.0.20 → 1.0.22
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/dist/admin.cjs +194 -75
- package/dist/admin.cjs.map +1 -1
- package/dist/admin.js +188 -70
- package/dist/admin.js.map +1 -1
- package/dist/api.cjs +3230 -259
- package/dist/api.cjs.map +1 -1
- package/dist/api.d.cts +1 -1
- package/dist/api.d.ts +1 -1
- package/dist/api.js +3232 -252
- package/dist/api.js.map +1 -1
- package/dist/{index-DGtM2Gsk.d.cts → index-BGAh4fPQ.d.cts} +18 -1
- package/dist/{index--GBYw5JE.d.ts → index-Cnwh7B3r.d.ts} +18 -1
- package/dist/index.cjs +753 -209
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +34 -9
- package/dist/index.d.ts +34 -9
- package/dist/index.js +753 -209
- package/dist/index.js.map +1 -1
- package/dist/migrations/1775300000000-LlmAgents.ts +57 -57
- package/dist/migrations/1775300000001-LlmAgentsValidationRulesText.ts +43 -43
- package/dist/migrations/1775300000002-SeedLlmAgentsPermissions.ts +33 -33
- package/dist/migrations/1775300000003-LlmAgentKnowledgeDocuments.ts +50 -50
- package/package.json +2 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CompanyDetails, T as TemplateContext, E as EmailTemplateResult, a as EmailTemplateName, O as OrderPlacedLineItem, S as StorageService, b as EntityMap$2 } from './index-
|
|
2
|
-
export { A as AnalyticsHandlerConfig, c as AuthHandlersConfig, B as BlogBySlugConfig, d as ChangePasswordConfig, e as ChatPublicConfig, f as CmsApiHandlerConfig, g as CmsGetter, h as CrudHandlerOptions, D as DashboardStatsConfig, i as EcommerceAnalyticsConfig, F as ForgotPasswordConfig, j as FormBySlugConfig, G as GetPublicSettingsGroupConfig, k as GetPublicSettingsGroupDataSource, I as InviteAcceptConfig, L as LlmAgentKnowledgeApiConfig, l as LlmAgentValidationRulesJson, P as ParsedLlmAgentValidation, m as SetPasswordConfig, n as SettingsApiConfig, o as SocialLinkItem, p as StorefrontApiConfig, q as StorefrontOtpFlags, U as UploadHandlerConfig, r as UserAuthApiConfig, s as UserAvatarConfig, t as UserProfileConfig, u as UsersApiConfig, v as createAnalyticsHandlers, w as createBlogBySlugHandler, x as createChangePasswordHandler, y as createCmsApiHandler, z as createCrudByIdHandler, H as createCrudHandler, J as createDashboardStatsHandler, K as createEcommerceAnalyticsHandler, M as createForgotPasswordHandler, N as createFormBySlugHandler, Q as createInviteAcceptHandler, R as createLlmAgentKnowledgeHandlers, V as createMediaZipExtractHandler, W as createSetPasswordHandler, X as createSettingsApiHandlers, Y as createStorefrontApiHandler, Z as createUploadHandler, _ as createUserAuthApiRouter, $ as createUserAvatarHandler, a0 as createUserProfileHandler, a1 as createUsersApiHandlers, a2 as getCompanyDetailsFromSettings, a3 as getPublicSettingsGroup, a4 as mergeEmailLayoutCompanyDetails, a5 as mergeGuardrailsIntoSystemPrompt, a6 as parseLlmAgentValidationRules, a7 as validateUserMessageAgainstAgentRules, a8 as validateUserMessageAgainstStructuredRules } from './index-
|
|
1
|
+
import { C as CompanyDetails, T as TemplateContext, E as EmailTemplateResult, a as EmailTemplateName, O as OrderPlacedLineItem, S as StorageService, b as EntityMap$2 } from './index-BGAh4fPQ.cjs';
|
|
2
|
+
export { A as AnalyticsHandlerConfig, c as AuthHandlersConfig, B as BlogBySlugConfig, d as ChangePasswordConfig, e as ChatPublicConfig, f as CmsApiHandlerConfig, g as CmsGetter, h as CrudHandlerOptions, D as DashboardStatsConfig, i as EcommerceAnalyticsConfig, F as ForgotPasswordConfig, j as FormBySlugConfig, G as GetPublicSettingsGroupConfig, k as GetPublicSettingsGroupDataSource, I as InviteAcceptConfig, L as LlmAgentKnowledgeApiConfig, l as LlmAgentValidationRulesJson, P as ParsedLlmAgentValidation, m as SetPasswordConfig, n as SettingsApiConfig, o as SocialLinkItem, p as StorefrontApiConfig, q as StorefrontOtpFlags, U as UploadHandlerConfig, r as UserAuthApiConfig, s as UserAvatarConfig, t as UserProfileConfig, u as UsersApiConfig, v as createAnalyticsHandlers, w as createBlogBySlugHandler, x as createChangePasswordHandler, y as createCmsApiHandler, z as createCrudByIdHandler, H as createCrudHandler, J as createDashboardStatsHandler, K as createEcommerceAnalyticsHandler, M as createForgotPasswordHandler, N as createFormBySlugHandler, Q as createInviteAcceptHandler, R as createLlmAgentKnowledgeHandlers, V as createMediaZipExtractHandler, W as createSetPasswordHandler, X as createSettingsApiHandlers, Y as createStorefrontApiHandler, Z as createUploadHandler, _ as createUserAuthApiRouter, $ as createUserAvatarHandler, a0 as createUserProfileHandler, a1 as createUsersApiHandlers, a2 as getCompanyDetailsFromSettings, a3 as getPublicSettingsGroup, a4 as mergeEmailLayoutCompanyDetails, a5 as mergeGuardrailsIntoSystemPrompt, a6 as parseLlmAgentValidationRules, a7 as validateUserMessageAgainstAgentRules, a8 as validateUserMessageAgainstStructuredRules } from './index-BGAh4fPQ.cjs';
|
|
3
3
|
import { ClassValue } from 'clsx';
|
|
4
4
|
import * as typeorm from 'typeorm';
|
|
5
5
|
import { DataSource, EntityTarget, ObjectLiteral } from 'typeorm';
|
|
@@ -532,40 +532,48 @@ interface LlmServiceInterface {
|
|
|
532
532
|
streamChatAgent(options: LlmAgentOptions): AsyncIterable<string>;
|
|
533
533
|
/**
|
|
534
534
|
* Embeddings for RAG / knowledge base. Wire format depends on {@link LlmServiceEmbedOptions}:
|
|
535
|
-
* OpenAI `{base}/v1/embeddings
|
|
535
|
+
* OpenAI `{base}/v1/embeddings`, or Hugging Face via `@huggingface/inference` (Hub-routed feature extraction) with legacy HTTP fallback.
|
|
536
536
|
*/
|
|
537
537
|
embed?(text: string, options?: {
|
|
538
538
|
model?: string;
|
|
539
539
|
}): Promise<number[]>;
|
|
540
540
|
}
|
|
541
|
-
/**
|
|
542
|
-
* Normalize Hugging Face Inference feature-extraction response to a single `number[]`.
|
|
543
|
-
*/
|
|
544
541
|
declare function parseHfInferenceEmbeddingBody(data: unknown): number[] | null;
|
|
545
542
|
type LlmEmbeddingProvider = 'openai' | 'huggingface';
|
|
546
543
|
interface LlmServiceEmbedOptions {
|
|
547
544
|
embeddingProvider?: LlmEmbeddingProvider;
|
|
548
|
-
/**
|
|
545
|
+
/** Legacy manual HTTP base when the Inference SDK path fails; default `https://router.huggingface.co/v1` (router host is normalized to `…/hf-inference`). */
|
|
549
546
|
hfInferenceBaseUrl?: string;
|
|
550
547
|
/** Token for embedding calls; defaults to chat `apiKey`. */
|
|
551
548
|
embeddingApiKey?: string;
|
|
549
|
+
/**
|
|
550
|
+
* Default `model` for `POST …/v1/chat/completions` when the caller omits `model`.
|
|
551
|
+
* Set via plugin / CMS `LLM_CHAT_MODEL` or env `LLM_CHAT_MODEL`.
|
|
552
|
+
* If unset, the library picks a fallback from `LLM_GATEWAY_URL` (HF router vs OpenRouter-style).
|
|
553
|
+
*/
|
|
554
|
+
defaultChatModel?: string;
|
|
552
555
|
}
|
|
553
556
|
/**
|
|
554
557
|
* Set `LLM_DEBUG=1` (or `true` / `yes`) to log composed chat payloads.
|
|
555
558
|
* Set `LLM_EMBED_DEBUG=1` for per-request embedding logs (verbose with many chunks).
|
|
559
|
+
* Set `LLM_CHAT_MODEL` for the default chat model when agents/requests omit `model` (gateway-specific id).
|
|
560
|
+
* If unset, fallback is chosen from `LLM_GATEWAY_URL` (HF vs other).
|
|
556
561
|
*/
|
|
557
562
|
declare class LlmService implements LlmServiceInterface {
|
|
558
563
|
private static embedHttpErrorLogged;
|
|
559
564
|
private static embedShapeErrorLogged;
|
|
560
565
|
private static embedSuccessLogged;
|
|
561
566
|
private static hfDimensionMismatchWarned;
|
|
567
|
+
private static hfInferenceSdkErrorLogged;
|
|
562
568
|
private readonly baseURL;
|
|
563
569
|
private readonly apiKey;
|
|
564
570
|
private readonly defaultEmbeddingModel?;
|
|
565
571
|
private readonly embeddingProvider;
|
|
566
572
|
private readonly hfInferenceBaseURL;
|
|
567
573
|
private readonly embeddingApiKey;
|
|
574
|
+
private readonly defaultChatModel;
|
|
568
575
|
constructor(baseURL: string, apiKey: string, defaultEmbeddingModel?: string, embedOpts?: LlmServiceEmbedOptions);
|
|
576
|
+
private resolveChatModel;
|
|
569
577
|
private get base();
|
|
570
578
|
private get url();
|
|
571
579
|
private llmDebugEnabled;
|
|
@@ -576,6 +584,21 @@ declare class LlmService implements LlmServiceInterface {
|
|
|
576
584
|
embed(text: string, options?: {
|
|
577
585
|
model?: string;
|
|
578
586
|
}): Promise<number[]>;
|
|
587
|
+
/**
|
|
588
|
+
* POST `{ url }` with OpenAI-style `{ model, input }` and Bearer token; parses `{ data:[{embedding}] }`.
|
|
589
|
+
*/
|
|
590
|
+
private fetchOpenAiShapeEmbeddings;
|
|
591
|
+
/**
|
|
592
|
+
* Hugging Face–recommended path: Hub resolves a provider that supports `feature-extraction` for the model.
|
|
593
|
+
*/
|
|
594
|
+
private embedViaHuggingfaceInferenceSdk;
|
|
595
|
+
/** Base URL for legacy `…/pipeline/…` and `…/models/{model}` tries (HF router only). */
|
|
596
|
+
private hfLegacyInferenceBase;
|
|
597
|
+
/**
|
|
598
|
+
* Hugging Face embeddings: `@huggingface/inference` (Hub-routed feature extraction), then
|
|
599
|
+
* legacy direct `hf-inference` HTTP tries. Note: `https://router.huggingface.co/v1/embeddings` is not
|
|
600
|
+
* offered for embeddings (OpenAI-compatible `/v1` on HF is chat-only).
|
|
601
|
+
*/
|
|
579
602
|
private embedHuggingFaceInference;
|
|
580
603
|
private buildAgentMessages;
|
|
581
604
|
chatAgent(options: LlmAgentOptions): Promise<{
|
|
@@ -591,14 +614,16 @@ declare class LlmService implements LlmServiceInterface {
|
|
|
591
614
|
interface LlmPluginConfig {
|
|
592
615
|
baseURL?: string;
|
|
593
616
|
apiKey?: string;
|
|
617
|
+
/** Default chat model when agents omit `model` (`POST /v1/chat/completions`). Env: `LLM_CHAT_MODEL`. If unset, inferred from `LLM_GATEWAY_URL` (HF vs OpenRouter-style default). */
|
|
618
|
+
defaultChatModel?: string;
|
|
594
619
|
/** Default model for embed(); also from env EMBEDDING_MODEL. */
|
|
595
620
|
embeddingModel?: string;
|
|
596
621
|
/**
|
|
597
622
|
* `openai` (default): `POST {LLM_GATEWAY_URL}/v1/embeddings`.
|
|
598
|
-
* `huggingface`:
|
|
623
|
+
* `huggingface`: `@huggingface/inference` feature extraction (Hub-routed), with legacy `…/hf-inference/…` HTTP fallback. Env: `EMBEDDING_PROVIDER=huggingface`.
|
|
599
624
|
*/
|
|
600
625
|
embeddingProvider?: LlmEmbeddingProvider;
|
|
601
|
-
/**
|
|
626
|
+
/** Legacy HTTP base if the SDK path fails; default `https://router.huggingface.co/v1` (router hosts map to `…/hf-inference`). Env: `HF_INFERENCE_URL`. */
|
|
602
627
|
hfInferenceBaseUrl?: string;
|
|
603
628
|
/** Optional; defaults to `apiKey`. Env: `EMBEDDING_API_KEY`. */
|
|
604
629
|
embeddingApiKey?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CompanyDetails, T as TemplateContext, E as EmailTemplateResult, a as EmailTemplateName, O as OrderPlacedLineItem, S as StorageService, b as EntityMap$2 } from './index
|
|
2
|
-
export { A as AnalyticsHandlerConfig, c as AuthHandlersConfig, B as BlogBySlugConfig, d as ChangePasswordConfig, e as ChatPublicConfig, f as CmsApiHandlerConfig, g as CmsGetter, h as CrudHandlerOptions, D as DashboardStatsConfig, i as EcommerceAnalyticsConfig, F as ForgotPasswordConfig, j as FormBySlugConfig, G as GetPublicSettingsGroupConfig, k as GetPublicSettingsGroupDataSource, I as InviteAcceptConfig, L as LlmAgentKnowledgeApiConfig, l as LlmAgentValidationRulesJson, P as ParsedLlmAgentValidation, m as SetPasswordConfig, n as SettingsApiConfig, o as SocialLinkItem, p as StorefrontApiConfig, q as StorefrontOtpFlags, U as UploadHandlerConfig, r as UserAuthApiConfig, s as UserAvatarConfig, t as UserProfileConfig, u as UsersApiConfig, v as createAnalyticsHandlers, w as createBlogBySlugHandler, x as createChangePasswordHandler, y as createCmsApiHandler, z as createCrudByIdHandler, H as createCrudHandler, J as createDashboardStatsHandler, K as createEcommerceAnalyticsHandler, M as createForgotPasswordHandler, N as createFormBySlugHandler, Q as createInviteAcceptHandler, R as createLlmAgentKnowledgeHandlers, V as createMediaZipExtractHandler, W as createSetPasswordHandler, X as createSettingsApiHandlers, Y as createStorefrontApiHandler, Z as createUploadHandler, _ as createUserAuthApiRouter, $ as createUserAvatarHandler, a0 as createUserProfileHandler, a1 as createUsersApiHandlers, a2 as getCompanyDetailsFromSettings, a3 as getPublicSettingsGroup, a4 as mergeEmailLayoutCompanyDetails, a5 as mergeGuardrailsIntoSystemPrompt, a6 as parseLlmAgentValidationRules, a7 as validateUserMessageAgainstAgentRules, a8 as validateUserMessageAgainstStructuredRules } from './index
|
|
1
|
+
import { C as CompanyDetails, T as TemplateContext, E as EmailTemplateResult, a as EmailTemplateName, O as OrderPlacedLineItem, S as StorageService, b as EntityMap$2 } from './index-Cnwh7B3r.js';
|
|
2
|
+
export { A as AnalyticsHandlerConfig, c as AuthHandlersConfig, B as BlogBySlugConfig, d as ChangePasswordConfig, e as ChatPublicConfig, f as CmsApiHandlerConfig, g as CmsGetter, h as CrudHandlerOptions, D as DashboardStatsConfig, i as EcommerceAnalyticsConfig, F as ForgotPasswordConfig, j as FormBySlugConfig, G as GetPublicSettingsGroupConfig, k as GetPublicSettingsGroupDataSource, I as InviteAcceptConfig, L as LlmAgentKnowledgeApiConfig, l as LlmAgentValidationRulesJson, P as ParsedLlmAgentValidation, m as SetPasswordConfig, n as SettingsApiConfig, o as SocialLinkItem, p as StorefrontApiConfig, q as StorefrontOtpFlags, U as UploadHandlerConfig, r as UserAuthApiConfig, s as UserAvatarConfig, t as UserProfileConfig, u as UsersApiConfig, v as createAnalyticsHandlers, w as createBlogBySlugHandler, x as createChangePasswordHandler, y as createCmsApiHandler, z as createCrudByIdHandler, H as createCrudHandler, J as createDashboardStatsHandler, K as createEcommerceAnalyticsHandler, M as createForgotPasswordHandler, N as createFormBySlugHandler, Q as createInviteAcceptHandler, R as createLlmAgentKnowledgeHandlers, V as createMediaZipExtractHandler, W as createSetPasswordHandler, X as createSettingsApiHandlers, Y as createStorefrontApiHandler, Z as createUploadHandler, _ as createUserAuthApiRouter, $ as createUserAvatarHandler, a0 as createUserProfileHandler, a1 as createUsersApiHandlers, a2 as getCompanyDetailsFromSettings, a3 as getPublicSettingsGroup, a4 as mergeEmailLayoutCompanyDetails, a5 as mergeGuardrailsIntoSystemPrompt, a6 as parseLlmAgentValidationRules, a7 as validateUserMessageAgainstAgentRules, a8 as validateUserMessageAgainstStructuredRules } from './index-Cnwh7B3r.js';
|
|
3
3
|
import { ClassValue } from 'clsx';
|
|
4
4
|
import * as typeorm from 'typeorm';
|
|
5
5
|
import { DataSource, EntityTarget, ObjectLiteral } from 'typeorm';
|
|
@@ -532,40 +532,48 @@ interface LlmServiceInterface {
|
|
|
532
532
|
streamChatAgent(options: LlmAgentOptions): AsyncIterable<string>;
|
|
533
533
|
/**
|
|
534
534
|
* Embeddings for RAG / knowledge base. Wire format depends on {@link LlmServiceEmbedOptions}:
|
|
535
|
-
* OpenAI `{base}/v1/embeddings
|
|
535
|
+
* OpenAI `{base}/v1/embeddings`, or Hugging Face via `@huggingface/inference` (Hub-routed feature extraction) with legacy HTTP fallback.
|
|
536
536
|
*/
|
|
537
537
|
embed?(text: string, options?: {
|
|
538
538
|
model?: string;
|
|
539
539
|
}): Promise<number[]>;
|
|
540
540
|
}
|
|
541
|
-
/**
|
|
542
|
-
* Normalize Hugging Face Inference feature-extraction response to a single `number[]`.
|
|
543
|
-
*/
|
|
544
541
|
declare function parseHfInferenceEmbeddingBody(data: unknown): number[] | null;
|
|
545
542
|
type LlmEmbeddingProvider = 'openai' | 'huggingface';
|
|
546
543
|
interface LlmServiceEmbedOptions {
|
|
547
544
|
embeddingProvider?: LlmEmbeddingProvider;
|
|
548
|
-
/**
|
|
545
|
+
/** Legacy manual HTTP base when the Inference SDK path fails; default `https://router.huggingface.co/v1` (router host is normalized to `…/hf-inference`). */
|
|
549
546
|
hfInferenceBaseUrl?: string;
|
|
550
547
|
/** Token for embedding calls; defaults to chat `apiKey`. */
|
|
551
548
|
embeddingApiKey?: string;
|
|
549
|
+
/**
|
|
550
|
+
* Default `model` for `POST …/v1/chat/completions` when the caller omits `model`.
|
|
551
|
+
* Set via plugin / CMS `LLM_CHAT_MODEL` or env `LLM_CHAT_MODEL`.
|
|
552
|
+
* If unset, the library picks a fallback from `LLM_GATEWAY_URL` (HF router vs OpenRouter-style).
|
|
553
|
+
*/
|
|
554
|
+
defaultChatModel?: string;
|
|
552
555
|
}
|
|
553
556
|
/**
|
|
554
557
|
* Set `LLM_DEBUG=1` (or `true` / `yes`) to log composed chat payloads.
|
|
555
558
|
* Set `LLM_EMBED_DEBUG=1` for per-request embedding logs (verbose with many chunks).
|
|
559
|
+
* Set `LLM_CHAT_MODEL` for the default chat model when agents/requests omit `model` (gateway-specific id).
|
|
560
|
+
* If unset, fallback is chosen from `LLM_GATEWAY_URL` (HF vs other).
|
|
556
561
|
*/
|
|
557
562
|
declare class LlmService implements LlmServiceInterface {
|
|
558
563
|
private static embedHttpErrorLogged;
|
|
559
564
|
private static embedShapeErrorLogged;
|
|
560
565
|
private static embedSuccessLogged;
|
|
561
566
|
private static hfDimensionMismatchWarned;
|
|
567
|
+
private static hfInferenceSdkErrorLogged;
|
|
562
568
|
private readonly baseURL;
|
|
563
569
|
private readonly apiKey;
|
|
564
570
|
private readonly defaultEmbeddingModel?;
|
|
565
571
|
private readonly embeddingProvider;
|
|
566
572
|
private readonly hfInferenceBaseURL;
|
|
567
573
|
private readonly embeddingApiKey;
|
|
574
|
+
private readonly defaultChatModel;
|
|
568
575
|
constructor(baseURL: string, apiKey: string, defaultEmbeddingModel?: string, embedOpts?: LlmServiceEmbedOptions);
|
|
576
|
+
private resolveChatModel;
|
|
569
577
|
private get base();
|
|
570
578
|
private get url();
|
|
571
579
|
private llmDebugEnabled;
|
|
@@ -576,6 +584,21 @@ declare class LlmService implements LlmServiceInterface {
|
|
|
576
584
|
embed(text: string, options?: {
|
|
577
585
|
model?: string;
|
|
578
586
|
}): Promise<number[]>;
|
|
587
|
+
/**
|
|
588
|
+
* POST `{ url }` with OpenAI-style `{ model, input }` and Bearer token; parses `{ data:[{embedding}] }`.
|
|
589
|
+
*/
|
|
590
|
+
private fetchOpenAiShapeEmbeddings;
|
|
591
|
+
/**
|
|
592
|
+
* Hugging Face–recommended path: Hub resolves a provider that supports `feature-extraction` for the model.
|
|
593
|
+
*/
|
|
594
|
+
private embedViaHuggingfaceInferenceSdk;
|
|
595
|
+
/** Base URL for legacy `…/pipeline/…` and `…/models/{model}` tries (HF router only). */
|
|
596
|
+
private hfLegacyInferenceBase;
|
|
597
|
+
/**
|
|
598
|
+
* Hugging Face embeddings: `@huggingface/inference` (Hub-routed feature extraction), then
|
|
599
|
+
* legacy direct `hf-inference` HTTP tries. Note: `https://router.huggingface.co/v1/embeddings` is not
|
|
600
|
+
* offered for embeddings (OpenAI-compatible `/v1` on HF is chat-only).
|
|
601
|
+
*/
|
|
579
602
|
private embedHuggingFaceInference;
|
|
580
603
|
private buildAgentMessages;
|
|
581
604
|
chatAgent(options: LlmAgentOptions): Promise<{
|
|
@@ -591,14 +614,16 @@ declare class LlmService implements LlmServiceInterface {
|
|
|
591
614
|
interface LlmPluginConfig {
|
|
592
615
|
baseURL?: string;
|
|
593
616
|
apiKey?: string;
|
|
617
|
+
/** Default chat model when agents omit `model` (`POST /v1/chat/completions`). Env: `LLM_CHAT_MODEL`. If unset, inferred from `LLM_GATEWAY_URL` (HF vs OpenRouter-style default). */
|
|
618
|
+
defaultChatModel?: string;
|
|
594
619
|
/** Default model for embed(); also from env EMBEDDING_MODEL. */
|
|
595
620
|
embeddingModel?: string;
|
|
596
621
|
/**
|
|
597
622
|
* `openai` (default): `POST {LLM_GATEWAY_URL}/v1/embeddings`.
|
|
598
|
-
* `huggingface`:
|
|
623
|
+
* `huggingface`: `@huggingface/inference` feature extraction (Hub-routed), with legacy `…/hf-inference/…` HTTP fallback. Env: `EMBEDDING_PROVIDER=huggingface`.
|
|
599
624
|
*/
|
|
600
625
|
embeddingProvider?: LlmEmbeddingProvider;
|
|
601
|
-
/**
|
|
626
|
+
/** Legacy HTTP base if the SDK path fails; default `https://router.huggingface.co/v1` (router hosts map to `…/hf-inference`). Env: `HF_INFERENCE_URL`. */
|
|
602
627
|
hfInferenceBaseUrl?: string;
|
|
603
628
|
/** Optional; defaults to `apiKey`. Env: `EMBEDDING_API_KEY`. */
|
|
604
629
|
embeddingApiKey?: string;
|