echo-ai-sdk-ts 2.3.1 → 2.5.0
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/README.md +35 -0
- package/dist/index.d.mts +139 -2
- package/dist/index.d.ts +139 -2
- package/dist/index.js +11843 -13910
- package/dist/index.mjs +11709 -11559
- package/package.json +12 -9
package/README.md
CHANGED
|
@@ -113,6 +113,41 @@ bot.use(async ({ sessionId, message }) => {
|
|
|
113
113
|
});
|
|
114
114
|
```
|
|
115
115
|
|
|
116
|
+
|
|
117
|
+
### 🚀 Tier 2 Pro-Grade Features
|
|
118
|
+
|
|
119
|
+
#### 🌐 Omnichannel Sync
|
|
120
|
+
Connect your bot to Slack and Telegram while maintaining a single user context.
|
|
121
|
+
```typescript
|
|
122
|
+
import { TelegramAdapter, SlackAdapter } from "echo-ai-sdk";
|
|
123
|
+
|
|
124
|
+
const tg = new TelegramAdapter({ bot, token: "TG_TOKEN" });
|
|
125
|
+
await tg.start();
|
|
126
|
+
|
|
127
|
+
const slack = new SlackAdapter({ bot, signingSecret: "...", token: "..." });
|
|
128
|
+
await slack.start();
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
#### 💾 Persistent Session Store
|
|
132
|
+
Move beyond memory. Use `FileSessionStore` for local persistence or implement `SessionStore` for Redis.
|
|
133
|
+
```typescript
|
|
134
|
+
import { FileSessionStore } from "echo-ai-sdk";
|
|
135
|
+
const bot = new CustomerSupportBot({
|
|
136
|
+
sessionStore: new FileSessionStore("./sessions"),
|
|
137
|
+
});
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
#### 📈 Outcome-Based Billing & ROI
|
|
141
|
+
Track the *real value* of your AI by recording business outcomes.
|
|
142
|
+
```typescript
|
|
143
|
+
// Inside a tool or middleware
|
|
144
|
+
bot.trackOutcome(sessionId, "lead_captured", 50.0);
|
|
145
|
+
|
|
146
|
+
const stats = bot.analytics.getSnapshot();
|
|
147
|
+
console.log(`ROI: ${stats.roi * 100}%`);
|
|
148
|
+
console.log(`Value Generated: $${stats.totalValueGeneratedUsd}`);
|
|
149
|
+
```
|
|
150
|
+
|
|
116
151
|
---
|
|
117
152
|
|
|
118
153
|
## Installation
|
package/dist/index.d.mts
CHANGED
|
@@ -655,6 +655,7 @@ interface ConversationRecord {
|
|
|
655
655
|
topQueries: string[];
|
|
656
656
|
responseTimes: number[];
|
|
657
657
|
model?: string;
|
|
658
|
+
variantId?: string;
|
|
658
659
|
}
|
|
659
660
|
interface AnalyticsSnapshot {
|
|
660
661
|
totalConversations: number;
|
|
@@ -667,6 +668,12 @@ interface AnalyticsSnapshot {
|
|
|
667
668
|
totalCostUsd: number;
|
|
668
669
|
totalValueGeneratedUsd: number;
|
|
669
670
|
roi: number;
|
|
671
|
+
variants?: Record<string, {
|
|
672
|
+
totalConversations: number;
|
|
673
|
+
totalValueGeneratedUsd: number;
|
|
674
|
+
resolutionRate: number;
|
|
675
|
+
roi: number;
|
|
676
|
+
}>;
|
|
670
677
|
avgTokensPerConversation: number;
|
|
671
678
|
avgCostPerConversation: number;
|
|
672
679
|
topQueries: {
|
|
@@ -686,7 +693,7 @@ declare class ConversationAnalytics {
|
|
|
686
693
|
constructor(outcomeTracker?: OutcomeTracker);
|
|
687
694
|
estimateTokens(text: string): number;
|
|
688
695
|
calculateCost(model: string, tokens: number, type?: "input" | "output"): number;
|
|
689
|
-
startConversation(sessionId: string, model?: string): void;
|
|
696
|
+
startConversation(sessionId: string, model?: string, variantId?: string): void;
|
|
690
697
|
recordQuery(sessionId: string, query: string): void;
|
|
691
698
|
recordResponse(sessionId: string, reply: string, latencyMs: number): void;
|
|
692
699
|
markResolved(sessionId: string): void;
|
|
@@ -784,6 +791,85 @@ declare class FileSessionStore implements SessionStore {
|
|
|
784
791
|
clear(): Promise<void>;
|
|
785
792
|
}
|
|
786
793
|
|
|
794
|
+
interface RedactionRule {
|
|
795
|
+
name: string;
|
|
796
|
+
pattern: RegExp;
|
|
797
|
+
placeholder: string;
|
|
798
|
+
}
|
|
799
|
+
declare const DEFAULT_REDACTION_RULES: RedactionRule[];
|
|
800
|
+
declare class PIIRedactor {
|
|
801
|
+
private rules;
|
|
802
|
+
constructor(rules?: RedactionRule[]);
|
|
803
|
+
/** Scans text and replaces any matched patterns with their placeholders. */
|
|
804
|
+
redact(text: string): string;
|
|
805
|
+
/** Adds custom redaction rules to the engine. */
|
|
806
|
+
addRule(rule: RedactionRule): void;
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
interface ExperimentVariant {
|
|
810
|
+
id: string;
|
|
811
|
+
weight: number;
|
|
812
|
+
config: Record<string, any>;
|
|
813
|
+
}
|
|
814
|
+
interface Experiment {
|
|
815
|
+
name: string;
|
|
816
|
+
variants: ExperimentVariant[];
|
|
817
|
+
}
|
|
818
|
+
declare class ExperimentManager {
|
|
819
|
+
private experiments;
|
|
820
|
+
constructor(experiments?: Experiment[]);
|
|
821
|
+
registerExperiment(exp: Experiment): void;
|
|
822
|
+
/**
|
|
823
|
+
* Assigns a user to a specific variant based on deterministic hashing of their sessionId.
|
|
824
|
+
* This guarantees 'sticky sessions' where the same user always gets the same A/B test variant.
|
|
825
|
+
*/
|
|
826
|
+
assignVariant(experimentName: string, sessionId: string): string | null;
|
|
827
|
+
/** Retrieves the variant config object for an assigned variant id. */
|
|
828
|
+
getVariantConfig(experimentName: string, variantId: string): Record<string, any> | null;
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
interface TTSConfig {
|
|
832
|
+
apiKey: string;
|
|
833
|
+
model?: string;
|
|
834
|
+
}
|
|
835
|
+
declare class HuggingFaceTTS {
|
|
836
|
+
private client;
|
|
837
|
+
private defaultModel;
|
|
838
|
+
constructor(config: TTSConfig);
|
|
839
|
+
/**
|
|
840
|
+
* Converts an AI text response into a spoken audio Blob.
|
|
841
|
+
* Useful for voice-enabled chatbots or IVR systems.
|
|
842
|
+
*/
|
|
843
|
+
generateAudio(text: string): Promise<Blob>;
|
|
844
|
+
/**
|
|
845
|
+
* Helper syntax for Node.js backends needing buffers instead of Blobs.
|
|
846
|
+
*/
|
|
847
|
+
generateBuffer(text: string): Promise<Buffer>;
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
interface ImageGenConfig {
|
|
851
|
+
apiKey: string;
|
|
852
|
+
model?: string;
|
|
853
|
+
}
|
|
854
|
+
declare class HuggingFaceImageGen {
|
|
855
|
+
private client;
|
|
856
|
+
private defaultModel;
|
|
857
|
+
constructor(config: ImageGenConfig);
|
|
858
|
+
/**
|
|
859
|
+
* Generates an image based on the prompt.
|
|
860
|
+
* Returns standard image Blob.
|
|
861
|
+
*/
|
|
862
|
+
generate(prompt: string): Promise<Blob>;
|
|
863
|
+
/**
|
|
864
|
+
* Generates a base64 encoded string compatible with markdown or HTML `img src`.
|
|
865
|
+
*/
|
|
866
|
+
generateBase64(prompt: string): Promise<string>;
|
|
867
|
+
/**
|
|
868
|
+
* Exposes this generator as a ToolContext that the AgentExecutor can use dynamically.
|
|
869
|
+
*/
|
|
870
|
+
asTool(): ToolContext;
|
|
871
|
+
}
|
|
872
|
+
|
|
787
873
|
interface SupportBotConfig {
|
|
788
874
|
gateway: AIModelGateway;
|
|
789
875
|
companyName: string;
|
|
@@ -798,6 +884,10 @@ interface SupportBotConfig {
|
|
|
798
884
|
greeting?: string;
|
|
799
885
|
systemPrompt?: string;
|
|
800
886
|
maxIterations?: number;
|
|
887
|
+
enablePIIRedaction?: boolean;
|
|
888
|
+
experiments?: Experiment[];
|
|
889
|
+
tts?: TTSConfig;
|
|
890
|
+
imageGen?: ImageGenConfig;
|
|
801
891
|
}
|
|
802
892
|
type BotMiddleware = (ctx: {
|
|
803
893
|
sessionId: string;
|
|
@@ -817,7 +907,12 @@ declare class CustomerSupportBot {
|
|
|
817
907
|
outcomeTracker: OutcomeTracker;
|
|
818
908
|
sessionStore: SessionStore;
|
|
819
909
|
handoff?: HandoffManager;
|
|
910
|
+
piiRedactor?: PIIRedactor;
|
|
911
|
+
experimentManager?: ExperimentManager;
|
|
912
|
+
ttsEngine?: HuggingFaceTTS;
|
|
913
|
+
imageGenEngine?: HuggingFaceImageGen;
|
|
820
914
|
greeting: string;
|
|
915
|
+
private defaultSystemPrompt;
|
|
821
916
|
private middlewares;
|
|
822
917
|
constructor(config: SupportBotConfig);
|
|
823
918
|
/** Register a middleware function to run before every chat turn. */
|
|
@@ -826,6 +921,13 @@ declare class CustomerSupportBot {
|
|
|
826
921
|
trackOutcome(sessionId: string, type: string, valueUsd?: number, metadata?: Record<string, any>): void;
|
|
827
922
|
/** Process a customer message and return the bot's response. */
|
|
828
923
|
chat(sessionId: string, message: string): Promise<string>;
|
|
924
|
+
/**
|
|
925
|
+
* Process a customer message and return both text and a spoken audio Buffer using the TTS engine.
|
|
926
|
+
*/
|
|
927
|
+
chatWithVoice(sessionId: string, message: string): Promise<{
|
|
928
|
+
text: string;
|
|
929
|
+
audio?: Buffer;
|
|
930
|
+
}>;
|
|
829
931
|
/** Start tracking analytics for a new session. */
|
|
830
932
|
initSession(sessionId: string): void;
|
|
831
933
|
}
|
|
@@ -933,4 +1035,39 @@ declare class TelegramAdapter extends ChannelAdapter {
|
|
|
933
1035
|
private sendMessage;
|
|
934
1036
|
}
|
|
935
1037
|
|
|
936
|
-
|
|
1038
|
+
interface EndpointConfig {
|
|
1039
|
+
accountId: string;
|
|
1040
|
+
repository: string;
|
|
1041
|
+
accelerator?: string;
|
|
1042
|
+
instanceSize?: string;
|
|
1043
|
+
instanceType?: string;
|
|
1044
|
+
framework?: "pytorch" | "tensorflow" | "custom";
|
|
1045
|
+
}
|
|
1046
|
+
/**
|
|
1047
|
+
* Manages Serverless / Dedicated Endpoints on Hugging Face API.
|
|
1048
|
+
* Uses REST API since @huggingface/inference is primarily for making queries.
|
|
1049
|
+
*/
|
|
1050
|
+
declare class InferenceEndpointManager {
|
|
1051
|
+
private token;
|
|
1052
|
+
private baseUrl;
|
|
1053
|
+
constructor(token: string);
|
|
1054
|
+
private get headers();
|
|
1055
|
+
/**
|
|
1056
|
+
* Programmatically creates a dedicated inference endpoint.
|
|
1057
|
+
*/
|
|
1058
|
+
createEndpoint(name: string, config: EndpointConfig): Promise<any>;
|
|
1059
|
+
/**
|
|
1060
|
+
* Retrieves the status of an existing endpoint (e.g. "pending", "running", "paused").
|
|
1061
|
+
*/
|
|
1062
|
+
getEndpointStatus(accountId: string, endpointName: string): Promise<string>;
|
|
1063
|
+
/**
|
|
1064
|
+
* Pauses a running endpoint to save costs.
|
|
1065
|
+
*/
|
|
1066
|
+
pauseEndpoint(accountId: string, endpointName: string): Promise<void>;
|
|
1067
|
+
/**
|
|
1068
|
+
* Resumes a paused endpoint.
|
|
1069
|
+
*/
|
|
1070
|
+
resumeEndpoint(accountId: string, endpointName: string): Promise<void>;
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1073
|
+
export { AIModelGateway, APIConnector, type APIConnectorConfig, AgentExecutor, AgentIterationLimitError, AgentPipeline, AgentRouter, type AgentTelemetry, type AnalyticsSnapshot, type BaseMemoryStore, BaseProvider, BaseSTTProvider, BaseSpeakerRecognizer, BaseTTSProvider, type BotMiddleware, CachedGateway, ChannelAdapter, type ChannelConfig, ChatAgent, type ChatMessage, ChatMessageSchema, type ChatRequest, ChatRequestSchema, type ChatResponse, ChatResponseSchema, ChatWidget, type ChatWidgetConfig, type ChatWidgetTheme, type ChunkOptions, ConfigurationError, ConversationAnalytics, type ConversationRecord, CustomerSupportBot, DEFAULT_REDACTION_RULES, EchoAI, EchoVoice, type EndpointConfig, type EscalationTrigger, type Experiment, ExperimentManager, type ExperimentVariant, type FetchResult, FileSessionStore, type GatewayMiddleware, GatewayRoutingError, type HandoffConfig, type HandoffEvent, HandoffManager, HuggingFaceImageGen, HuggingFaceTTS, type IdentificationResult, type ImageGenConfig, InMemoryStore, InferenceEndpointManager, KnowledgeBase, type KnowledgeBaseConfig, MemorySessionStore, MemoryVectorStore, OPENAI_PRICING, OpenAITTS, OpenAIWhisperSTT, type OutcomeRecord, OutcomeTracker, PIIRedactor, PromptRegistry, PromptTemplate, PromptVersionError, ProviderDependencyError, type RedactionRule, type STTOptions, type SearchResult, type ServerConfig, type SessionStore, SlackAdapter, type SlackConfig, type SpeakerProfile, StructuredOutputError, type SupportBotConfig, type TTSConfig, type TTSFormat, type TTSOptions, type TTSResult, type TTSVoice, TelegramAdapter, type TelegramConfig, ToolAgent, type ToolContext, ToolExecutionError, type TranscriptionResult, type TranscriptionSegment, type UsageMetrics, UsageMetricsSchema, ValidationError, type VectorEntry, type VerificationResult, VoiceprintStore, applyRequestMiddleware, applyResponseMiddleware, calculatorTool, chunkText, createChatHandler, createTool, dateTimeTool, startChatServer, webSearchTool };
|
package/dist/index.d.ts
CHANGED
|
@@ -655,6 +655,7 @@ interface ConversationRecord {
|
|
|
655
655
|
topQueries: string[];
|
|
656
656
|
responseTimes: number[];
|
|
657
657
|
model?: string;
|
|
658
|
+
variantId?: string;
|
|
658
659
|
}
|
|
659
660
|
interface AnalyticsSnapshot {
|
|
660
661
|
totalConversations: number;
|
|
@@ -667,6 +668,12 @@ interface AnalyticsSnapshot {
|
|
|
667
668
|
totalCostUsd: number;
|
|
668
669
|
totalValueGeneratedUsd: number;
|
|
669
670
|
roi: number;
|
|
671
|
+
variants?: Record<string, {
|
|
672
|
+
totalConversations: number;
|
|
673
|
+
totalValueGeneratedUsd: number;
|
|
674
|
+
resolutionRate: number;
|
|
675
|
+
roi: number;
|
|
676
|
+
}>;
|
|
670
677
|
avgTokensPerConversation: number;
|
|
671
678
|
avgCostPerConversation: number;
|
|
672
679
|
topQueries: {
|
|
@@ -686,7 +693,7 @@ declare class ConversationAnalytics {
|
|
|
686
693
|
constructor(outcomeTracker?: OutcomeTracker);
|
|
687
694
|
estimateTokens(text: string): number;
|
|
688
695
|
calculateCost(model: string, tokens: number, type?: "input" | "output"): number;
|
|
689
|
-
startConversation(sessionId: string, model?: string): void;
|
|
696
|
+
startConversation(sessionId: string, model?: string, variantId?: string): void;
|
|
690
697
|
recordQuery(sessionId: string, query: string): void;
|
|
691
698
|
recordResponse(sessionId: string, reply: string, latencyMs: number): void;
|
|
692
699
|
markResolved(sessionId: string): void;
|
|
@@ -784,6 +791,85 @@ declare class FileSessionStore implements SessionStore {
|
|
|
784
791
|
clear(): Promise<void>;
|
|
785
792
|
}
|
|
786
793
|
|
|
794
|
+
interface RedactionRule {
|
|
795
|
+
name: string;
|
|
796
|
+
pattern: RegExp;
|
|
797
|
+
placeholder: string;
|
|
798
|
+
}
|
|
799
|
+
declare const DEFAULT_REDACTION_RULES: RedactionRule[];
|
|
800
|
+
declare class PIIRedactor {
|
|
801
|
+
private rules;
|
|
802
|
+
constructor(rules?: RedactionRule[]);
|
|
803
|
+
/** Scans text and replaces any matched patterns with their placeholders. */
|
|
804
|
+
redact(text: string): string;
|
|
805
|
+
/** Adds custom redaction rules to the engine. */
|
|
806
|
+
addRule(rule: RedactionRule): void;
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
interface ExperimentVariant {
|
|
810
|
+
id: string;
|
|
811
|
+
weight: number;
|
|
812
|
+
config: Record<string, any>;
|
|
813
|
+
}
|
|
814
|
+
interface Experiment {
|
|
815
|
+
name: string;
|
|
816
|
+
variants: ExperimentVariant[];
|
|
817
|
+
}
|
|
818
|
+
declare class ExperimentManager {
|
|
819
|
+
private experiments;
|
|
820
|
+
constructor(experiments?: Experiment[]);
|
|
821
|
+
registerExperiment(exp: Experiment): void;
|
|
822
|
+
/**
|
|
823
|
+
* Assigns a user to a specific variant based on deterministic hashing of their sessionId.
|
|
824
|
+
* This guarantees 'sticky sessions' where the same user always gets the same A/B test variant.
|
|
825
|
+
*/
|
|
826
|
+
assignVariant(experimentName: string, sessionId: string): string | null;
|
|
827
|
+
/** Retrieves the variant config object for an assigned variant id. */
|
|
828
|
+
getVariantConfig(experimentName: string, variantId: string): Record<string, any> | null;
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
interface TTSConfig {
|
|
832
|
+
apiKey: string;
|
|
833
|
+
model?: string;
|
|
834
|
+
}
|
|
835
|
+
declare class HuggingFaceTTS {
|
|
836
|
+
private client;
|
|
837
|
+
private defaultModel;
|
|
838
|
+
constructor(config: TTSConfig);
|
|
839
|
+
/**
|
|
840
|
+
* Converts an AI text response into a spoken audio Blob.
|
|
841
|
+
* Useful for voice-enabled chatbots or IVR systems.
|
|
842
|
+
*/
|
|
843
|
+
generateAudio(text: string): Promise<Blob>;
|
|
844
|
+
/**
|
|
845
|
+
* Helper syntax for Node.js backends needing buffers instead of Blobs.
|
|
846
|
+
*/
|
|
847
|
+
generateBuffer(text: string): Promise<Buffer>;
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
interface ImageGenConfig {
|
|
851
|
+
apiKey: string;
|
|
852
|
+
model?: string;
|
|
853
|
+
}
|
|
854
|
+
declare class HuggingFaceImageGen {
|
|
855
|
+
private client;
|
|
856
|
+
private defaultModel;
|
|
857
|
+
constructor(config: ImageGenConfig);
|
|
858
|
+
/**
|
|
859
|
+
* Generates an image based on the prompt.
|
|
860
|
+
* Returns standard image Blob.
|
|
861
|
+
*/
|
|
862
|
+
generate(prompt: string): Promise<Blob>;
|
|
863
|
+
/**
|
|
864
|
+
* Generates a base64 encoded string compatible with markdown or HTML `img src`.
|
|
865
|
+
*/
|
|
866
|
+
generateBase64(prompt: string): Promise<string>;
|
|
867
|
+
/**
|
|
868
|
+
* Exposes this generator as a ToolContext that the AgentExecutor can use dynamically.
|
|
869
|
+
*/
|
|
870
|
+
asTool(): ToolContext;
|
|
871
|
+
}
|
|
872
|
+
|
|
787
873
|
interface SupportBotConfig {
|
|
788
874
|
gateway: AIModelGateway;
|
|
789
875
|
companyName: string;
|
|
@@ -798,6 +884,10 @@ interface SupportBotConfig {
|
|
|
798
884
|
greeting?: string;
|
|
799
885
|
systemPrompt?: string;
|
|
800
886
|
maxIterations?: number;
|
|
887
|
+
enablePIIRedaction?: boolean;
|
|
888
|
+
experiments?: Experiment[];
|
|
889
|
+
tts?: TTSConfig;
|
|
890
|
+
imageGen?: ImageGenConfig;
|
|
801
891
|
}
|
|
802
892
|
type BotMiddleware = (ctx: {
|
|
803
893
|
sessionId: string;
|
|
@@ -817,7 +907,12 @@ declare class CustomerSupportBot {
|
|
|
817
907
|
outcomeTracker: OutcomeTracker;
|
|
818
908
|
sessionStore: SessionStore;
|
|
819
909
|
handoff?: HandoffManager;
|
|
910
|
+
piiRedactor?: PIIRedactor;
|
|
911
|
+
experimentManager?: ExperimentManager;
|
|
912
|
+
ttsEngine?: HuggingFaceTTS;
|
|
913
|
+
imageGenEngine?: HuggingFaceImageGen;
|
|
820
914
|
greeting: string;
|
|
915
|
+
private defaultSystemPrompt;
|
|
821
916
|
private middlewares;
|
|
822
917
|
constructor(config: SupportBotConfig);
|
|
823
918
|
/** Register a middleware function to run before every chat turn. */
|
|
@@ -826,6 +921,13 @@ declare class CustomerSupportBot {
|
|
|
826
921
|
trackOutcome(sessionId: string, type: string, valueUsd?: number, metadata?: Record<string, any>): void;
|
|
827
922
|
/** Process a customer message and return the bot's response. */
|
|
828
923
|
chat(sessionId: string, message: string): Promise<string>;
|
|
924
|
+
/**
|
|
925
|
+
* Process a customer message and return both text and a spoken audio Buffer using the TTS engine.
|
|
926
|
+
*/
|
|
927
|
+
chatWithVoice(sessionId: string, message: string): Promise<{
|
|
928
|
+
text: string;
|
|
929
|
+
audio?: Buffer;
|
|
930
|
+
}>;
|
|
829
931
|
/** Start tracking analytics for a new session. */
|
|
830
932
|
initSession(sessionId: string): void;
|
|
831
933
|
}
|
|
@@ -933,4 +1035,39 @@ declare class TelegramAdapter extends ChannelAdapter {
|
|
|
933
1035
|
private sendMessage;
|
|
934
1036
|
}
|
|
935
1037
|
|
|
936
|
-
|
|
1038
|
+
interface EndpointConfig {
|
|
1039
|
+
accountId: string;
|
|
1040
|
+
repository: string;
|
|
1041
|
+
accelerator?: string;
|
|
1042
|
+
instanceSize?: string;
|
|
1043
|
+
instanceType?: string;
|
|
1044
|
+
framework?: "pytorch" | "tensorflow" | "custom";
|
|
1045
|
+
}
|
|
1046
|
+
/**
|
|
1047
|
+
* Manages Serverless / Dedicated Endpoints on Hugging Face API.
|
|
1048
|
+
* Uses REST API since @huggingface/inference is primarily for making queries.
|
|
1049
|
+
*/
|
|
1050
|
+
declare class InferenceEndpointManager {
|
|
1051
|
+
private token;
|
|
1052
|
+
private baseUrl;
|
|
1053
|
+
constructor(token: string);
|
|
1054
|
+
private get headers();
|
|
1055
|
+
/**
|
|
1056
|
+
* Programmatically creates a dedicated inference endpoint.
|
|
1057
|
+
*/
|
|
1058
|
+
createEndpoint(name: string, config: EndpointConfig): Promise<any>;
|
|
1059
|
+
/**
|
|
1060
|
+
* Retrieves the status of an existing endpoint (e.g. "pending", "running", "paused").
|
|
1061
|
+
*/
|
|
1062
|
+
getEndpointStatus(accountId: string, endpointName: string): Promise<string>;
|
|
1063
|
+
/**
|
|
1064
|
+
* Pauses a running endpoint to save costs.
|
|
1065
|
+
*/
|
|
1066
|
+
pauseEndpoint(accountId: string, endpointName: string): Promise<void>;
|
|
1067
|
+
/**
|
|
1068
|
+
* Resumes a paused endpoint.
|
|
1069
|
+
*/
|
|
1070
|
+
resumeEndpoint(accountId: string, endpointName: string): Promise<void>;
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1073
|
+
export { AIModelGateway, APIConnector, type APIConnectorConfig, AgentExecutor, AgentIterationLimitError, AgentPipeline, AgentRouter, type AgentTelemetry, type AnalyticsSnapshot, type BaseMemoryStore, BaseProvider, BaseSTTProvider, BaseSpeakerRecognizer, BaseTTSProvider, type BotMiddleware, CachedGateway, ChannelAdapter, type ChannelConfig, ChatAgent, type ChatMessage, ChatMessageSchema, type ChatRequest, ChatRequestSchema, type ChatResponse, ChatResponseSchema, ChatWidget, type ChatWidgetConfig, type ChatWidgetTheme, type ChunkOptions, ConfigurationError, ConversationAnalytics, type ConversationRecord, CustomerSupportBot, DEFAULT_REDACTION_RULES, EchoAI, EchoVoice, type EndpointConfig, type EscalationTrigger, type Experiment, ExperimentManager, type ExperimentVariant, type FetchResult, FileSessionStore, type GatewayMiddleware, GatewayRoutingError, type HandoffConfig, type HandoffEvent, HandoffManager, HuggingFaceImageGen, HuggingFaceTTS, type IdentificationResult, type ImageGenConfig, InMemoryStore, InferenceEndpointManager, KnowledgeBase, type KnowledgeBaseConfig, MemorySessionStore, MemoryVectorStore, OPENAI_PRICING, OpenAITTS, OpenAIWhisperSTT, type OutcomeRecord, OutcomeTracker, PIIRedactor, PromptRegistry, PromptTemplate, PromptVersionError, ProviderDependencyError, type RedactionRule, type STTOptions, type SearchResult, type ServerConfig, type SessionStore, SlackAdapter, type SlackConfig, type SpeakerProfile, StructuredOutputError, type SupportBotConfig, type TTSConfig, type TTSFormat, type TTSOptions, type TTSResult, type TTSVoice, TelegramAdapter, type TelegramConfig, ToolAgent, type ToolContext, ToolExecutionError, type TranscriptionResult, type TranscriptionSegment, type UsageMetrics, UsageMetricsSchema, ValidationError, type VectorEntry, type VerificationResult, VoiceprintStore, applyRequestMiddleware, applyResponseMiddleware, calculatorTool, chunkText, createChatHandler, createTool, dateTimeTool, startChatServer, webSearchTool };
|