@absolutejs/voice 0.0.22-beta.491 → 0.0.22-beta.492

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/index.d.ts CHANGED
@@ -97,8 +97,8 @@ export type { VoiceWebhookVerificationInput, VoiceWebhookVerificationReason, Voi
97
97
  export type { CreatePunctuationSemanticTurnDetectorOptions, CreateRegexSemanticTurnDetectorOptions, VoiceSemanticTurnDetector, VoiceSemanticTurnInput, VoiceSemanticTurnVerdict, } from "./semanticTurn";
98
98
  export { createMonologueAMDDetector } from "./amdDetector";
99
99
  export type { MonologueAMDDetectorOptions, VoiceAMDDetector, VoiceAMDDetectorInput, VoiceAMDVerdict, } from "./amdDetector";
100
- export { createVoiceRAGTool } from "./ragTool";
101
- export type { VoiceRAGCollectionLike, VoiceRAGQueryResult, VoiceRAGSearchInput, VoiceRAGToolArgs, VoiceRAGToolOptions, VoiceRAGToolResult, } from "./ragTool";
100
+ export { createVoiceRAGTool, extractVoiceRAGCitations } from "./ragTool";
101
+ export type { VoiceRAGCitationSummary, VoiceRAGCollectionLike, VoiceRAGQueryResult, VoiceRAGSearchInput, VoiceRAGToolArgs, VoiceRAGToolOptions, VoiceRAGToolResult, } from "./ragTool";
102
102
  export { createVoiceApiRequestTool, createVoiceDTMFTool, createVoiceEndCallTool, createVoiceTransferCallTool, createVoiceVoicemailDetectionTool, } from "./agentTools";
103
103
  export { fromVapiAssistantConfig } from "./vapiAdapter";
104
104
  export type { VapiAssistantConfig, VapiAssistantConfigModel, VapiAssistantConfigTool, VapiAssistantConfigTranscriber, VapiAssistantConfigTransferDestination, VapiAssistantConfigVoice, VapiAssistantMessage, VoiceFromVapiAssistantOptions, VoiceFromVapiAssistantResult, VoiceFromVapiCustomToolFactory, VoiceFromVapiCustomToolInput, VoiceFromVapiDTMFFactory, VoiceFromVapiKnowledgeBase, VoiceFromVapiModelFactory, VoiceFromVapiModelFactoryInput, VoiceFromVapiRouteHints, VoiceFromVapiUnsupportedReason, } from "./vapiAdapter";
package/dist/index.js CHANGED
@@ -36006,6 +36006,28 @@ var createMonologueAMDDetector = (options = {}) => {
36006
36006
  };
36007
36007
  };
36008
36008
  // src/ragTool.ts
36009
+ var extractVoiceRAGCitations = (toolResults, toolName = "searchKnowledgeBase") => {
36010
+ const out = [];
36011
+ for (const entry of toolResults) {
36012
+ if (entry.toolName !== toolName) {
36013
+ continue;
36014
+ }
36015
+ const result = entry.result;
36016
+ const citations = result?.citations;
36017
+ if (!Array.isArray(citations)) {
36018
+ continue;
36019
+ }
36020
+ for (const citation of citations) {
36021
+ out.push({
36022
+ chunkId: citation.chunkId,
36023
+ score: citation.score,
36024
+ source: citation.source,
36025
+ title: citation.title
36026
+ });
36027
+ }
36028
+ }
36029
+ return out;
36030
+ };
36009
36031
  var DEFAULT_TOOL_NAME = "searchKnowledgeBase";
36010
36032
  var DEFAULT_DESCRIPTION = "Search the knowledge base and return short grounded citations. Use this whenever the caller asks a question that may be answered by indexed reference material.";
36011
36033
  var DEFAULT_TOP_K = 6;
@@ -46800,6 +46822,7 @@ export {
46800
46822
  fetchVoiceProofTarget,
46801
46823
  failVoiceOpsTask,
46802
46824
  extractVoiceWebhookSignatureFromHeaders,
46825
+ extractVoiceRAGCitations,
46803
46826
  extractVoiceMediaPipelineIssueEntries,
46804
46827
  exportVoiceTrace,
46805
46828
  exportVoiceAuditTrail,
package/dist/ragTool.d.ts CHANGED
@@ -29,6 +29,16 @@ export type VoiceRAGToolResult = {
29
29
  query: string;
30
30
  topK: number;
31
31
  };
32
+ export type VoiceRAGCitationSummary = {
33
+ chunkId: string;
34
+ score: number;
35
+ source?: string;
36
+ title?: string;
37
+ };
38
+ export declare const extractVoiceRAGCitations: (toolResults: ReadonlyArray<{
39
+ result?: unknown;
40
+ toolName: string;
41
+ }>, toolName?: string) => VoiceRAGCitationSummary[];
32
42
  export type VoiceRAGToolOptions<TContext = unknown> = {
33
43
  allowedFilterKeys?: readonly string[];
34
44
  description?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@absolutejs/voice",
3
- "version": "0.0.22-beta.491",
3
+ "version": "0.0.22-beta.492",
4
4
  "description": "Voice primitives and Elysia plugin for AbsoluteJS",
5
5
  "repository": {
6
6
  "type": "git",