@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.
- package/build/static/js/main.js +1 -1
- package/build/static/js/main.js.map +1 -1
- package/dist/qa-bot-core.js +2 -2
- package/dist/qa-bot-core.js.map +1 -1
- package/dist/qa-bot-core.standalone.js +1 -1
- package/dist/qa-bot-core.standalone.js.map +1 -1
- package/dist/qa-bot-core.umd.cjs +2 -2
- package/dist/qa-bot-core.umd.cjs.map +1 -1
- package/dist/types/config.d.ts +13 -0
- package/dist/types/lib.d.ts +2 -0
- package/dist/types/utils/flows/qa-flow.d.ts +5 -3
- package/dist/types/utils/logger.d.ts +1 -1
- package/package.json +1 -1
package/dist/types/config.d.ts
CHANGED
|
@@ -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;
|
package/dist/types/lib.d.ts
CHANGED
|
@@ -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." | "
|
|
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.
|
|
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.
|
|
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",
|