@snf/qa-bot-core 0.2.30-rc.11 → 0.2.30-rc.13

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.
@@ -50,6 +50,19 @@ export interface QABotProps {
50
50
  qaEndpoint: string;
51
51
  welcomeMessage: string;
52
52
  ratingEndpoint?: string;
53
+ /**
54
+ * Endpoint for the capabilities API (e.g., /api/v1/capabilities).
55
+ * The wrapper can use this to fetch dynamic capability buttons on load.
56
+ * Core does not fetch from this — it's a passthrough for wrappers.
57
+ */
58
+ capabilitiesEndpoint?: string;
59
+ /**
60
+ * Rating endpoint for agent-handled responses (non-RAG).
61
+ * When the response metadata includes `rating_target: "agent"`,
62
+ * ratings are POSTed here instead of `ratingEndpoint`.
63
+ * Payload: { query_id, rating: "helpful"|"not_helpful", feedback? }
64
+ */
65
+ agentRatingEndpoint?: string;
53
66
  primaryColor?: string;
54
67
  secondaryColor?: string;
55
68
  botName?: string;
@@ -22,6 +22,8 @@ interface QABotConfig {
22
22
  apiKey: string;
23
23
  qaEndpoint: string;
24
24
  ratingEndpoint?: string;
25
+ capabilitiesEndpoint?: string;
26
+ agentRatingEndpoint?: string;
25
27
  defaultOpen?: boolean;
26
28
  embedded?: boolean;
27
29
  isLoggedIn: boolean;
@@ -6,8 +6,10 @@ import type { AnalyticsEventInput } from '../../contexts/AnalyticsContext';
6
6
  export interface CreateQAFlowParams {
7
7
  /** Q&A API endpoint (required) */
8
8
  endpoint: string;
9
- /** Rating API endpoint (optional) */
9
+ /** Rating API endpoint for RAG responses (optional) */
10
10
  ratingEndpoint?: string;
11
+ /** Rating API endpoint for agent responses (optional) */
12
+ agentRatingEndpoint?: string;
11
13
  /** API key for authentication (optional) */
12
14
  apiKey?: string;
13
15
  /** Function that returns current session ID */
@@ -40,7 +42,7 @@ export interface CreateQAFlowParams {
40
42
  * Creates the basic Q&A conversation flow
41
43
  * Handles questions, responses, and optional ratings
42
44
  */
43
- export declare const createQAFlow: ({ endpoint, ratingEndpoint, apiKey, sessionId: getSessionId, isResetting, isLoggedIn, allowAnonAccess, loginUrl, actingUser, trackEvent, getTurnstileToken, }: CreateQAFlowParams) => {
45
+ export declare const createQAFlow: ({ endpoint, ratingEndpoint, agentRatingEndpoint, apiKey, sessionId: getSessionId, isResetting, isLoggedIn, allowAnonAccess, loginUrl, actingUser, trackEvent, getTurnstileToken, }: CreateQAFlowParams) => {
44
46
  qa_loop: {
45
47
  message: string;
46
48
  component: React.JSX.Element;
@@ -51,7 +53,7 @@ export declare const createQAFlow: ({ endpoint, ratingEndpoint, apiKey, sessionI
51
53
  };
52
54
  } | {
53
55
  qa_loop: {
54
- message: (chatState: any) => Promise<"Thanks for the feedback! Feel free to ask another question." | "Verification failed. Please try your question again." | "I had trouble processing your question after verification. Please try again." | "Please verify you're human to continue." | "I apologize, but I'm having trouble processing your question. Please try again later.">;
56
+ message: (chatState: any) => Promise<"Thanks for the feedback! Feel free to ask another question." | "Verification failed. Please try your question again." | "I had trouble processing your question after verification. Please try again." | "One moment verifying your session…" | "I apologize, but I'm having trouble processing your question. Please try again later.">;
55
57
  options: (chatState: any) => string[];
56
58
  renderMarkdown: string[];
57
59
  chatDisabled: boolean;
@@ -7,7 +7,7 @@
7
7
  * Usage for consumers:
8
8
  * localStorage.setItem('QA_BOT_DEBUG', 'true'); // Enable debug logs + version
9
9
  */
10
- export declare const LIB_VERSION = "0.2.30-rc.11";
10
+ export declare const LIB_VERSION = "0.2.30-rc.13";
11
11
  export declare const logger: {
12
12
  version: () => void;
13
13
  session: (action: string, ...args: unknown[]) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snf/qa-bot-core",
3
- "version": "0.2.30-rc.11",
3
+ "version": "0.2.30-rc.13",
4
4
  "description": "A configurable chatbot setup for quick integration of RAG-powered Q&A and rating system",
5
5
  "main": "./dist/qa-bot-core.umd.cjs",
6
6
  "module": "./dist/qa-bot-core.js",