@botonic/plugin-knowledge-bases 0.23.1-alpha.0 → 0.23.1-alpha.1
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/lib/cjs/hubtype-knowledge-api-service.d.ts +3 -3
- package/lib/cjs/hubtype-knowledge-api-service.js +5 -3
- package/lib/cjs/hubtype-knowledge-api-service.js.map +1 -1
- package/lib/cjs/index.js +12 -22
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/types.d.ts +1 -1
- package/lib/esm/hubtype-knowledge-api-service.d.ts +3 -3
- package/lib/esm/hubtype-knowledge-api-service.js +5 -3
- package/lib/esm/hubtype-knowledge-api-service.js.map +1 -1
- package/lib/esm/index.js +12 -22
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/types.d.ts +1 -1
- package/package.json +1 -1
- package/src/hubtype-knowledge-api-service.ts +7 -5
- package/src/index.ts +12 -24
- package/src/types.ts +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { AxiosResponse } from 'axios';
|
|
2
2
|
export declare class HubtypeApiService {
|
|
3
|
-
private knowledgeBaseId;
|
|
4
3
|
private host;
|
|
4
|
+
private knowledgeBaseId;
|
|
5
5
|
private timeout;
|
|
6
|
-
constructor(
|
|
6
|
+
constructor(host: string, knowledgeBaseId: string, timeout?: number);
|
|
7
7
|
inference(authToken: string, chatId: string): Promise<AxiosResponse<{
|
|
8
|
-
|
|
8
|
+
answer: string;
|
|
9
9
|
has_knowledge: boolean;
|
|
10
10
|
sources: {
|
|
11
11
|
knowledge_source_id: string;
|
|
@@ -6,7 +6,7 @@ const tslib_1 = require("tslib");
|
|
|
6
6
|
const axios_1 = tslib_1.__importDefault(require("axios"));
|
|
7
7
|
const DEFAULT_TIMEOUT = 10000;
|
|
8
8
|
class HubtypeApiService {
|
|
9
|
-
constructor(
|
|
9
|
+
constructor(host, knowledgeBaseId, timeout) {
|
|
10
10
|
this.knowledgeBaseId = knowledgeBaseId;
|
|
11
11
|
this.host = host;
|
|
12
12
|
this.timeout = timeout || DEFAULT_TIMEOUT;
|
|
@@ -14,12 +14,14 @@ class HubtypeApiService {
|
|
|
14
14
|
async inference(authToken, chatId) {
|
|
15
15
|
return await (0, axios_1.default)({
|
|
16
16
|
method: 'POST',
|
|
17
|
-
url: `${this.host}/v1/ai/knowledge_bases/${this.knowledgeBaseId}/inference/`,
|
|
17
|
+
url: `${this.host}/external/v1/ai/knowledge_bases/${this.knowledgeBaseId}/inference/`,
|
|
18
18
|
headers: {
|
|
19
19
|
Authorization: `Bearer ${authToken}`,
|
|
20
20
|
'Content-Type': 'application/json',
|
|
21
21
|
},
|
|
22
|
-
data: {
|
|
22
|
+
data: {
|
|
23
|
+
chat_id: chatId,
|
|
24
|
+
},
|
|
23
25
|
timeout: this.timeout,
|
|
24
26
|
});
|
|
25
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hubtype-knowledge-api-service.js","sourceRoot":"","sources":["../../src/hubtype-knowledge-api-service.ts"],"names":[],"mappings":";;;;AAAA,yDAAyD;AACzD,0DAA4C;AAE5C,MAAM,eAAe,GAAG,KAAK,CAAA;AAE7B,MAAa,iBAAiB;IAK5B,YAAY,
|
|
1
|
+
{"version":3,"file":"hubtype-knowledge-api-service.js","sourceRoot":"","sources":["../../src/hubtype-knowledge-api-service.ts"],"names":[],"mappings":";;;;AAAA,yDAAyD;AACzD,0DAA4C;AAE5C,MAAM,eAAe,GAAG,KAAK,CAAA;AAE7B,MAAa,iBAAiB;IAK5B,YAAY,IAAY,EAAE,eAAuB,EAAE,OAAgB;QACjE,IAAI,CAAC,eAAe,GAAG,eAAe,CAAA;QACtC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,OAAO,GAAG,OAAO,IAAI,eAAe,CAAA;IAC3C,CAAC;IAED,KAAK,CAAC,SAAS,CACb,SAAiB,EACjB,MAAc;QAWd,OAAO,MAAM,IAAA,eAAK,EAAC;YACjB,MAAM,EAAE,MAAM;YACd,GAAG,EAAE,GAAG,IAAI,CAAC,IAAI,mCAAmC,IAAI,CAAC,eAAe,aAAa;YACrF,OAAO,EAAE;gBACP,aAAa,EAAE,UAAU,SAAS,EAAE;gBACpC,cAAc,EAAE,kBAAkB;aACnC;YACD,IAAI,EAAE;gBACJ,OAAO,EAAE,MAAM;aAChB;YACD,OAAO,EAAE,IAAI,CAAC,OAAO;SACtB,CAAC,CAAA;IACJ,CAAC;CACF;AArCD,8CAqCC"}
|
package/lib/cjs/index.js
CHANGED
|
@@ -4,36 +4,26 @@ const hubtype_knowledge_api_service_1 = require("./hubtype-knowledge-api-service
|
|
|
4
4
|
const isProd = process.env.NODE_ENV === 'production';
|
|
5
5
|
class BotonicPluginKnowledgeBases {
|
|
6
6
|
constructor(options) {
|
|
7
|
-
this.apiService = new hubtype_knowledge_api_service_1.HubtypeApiService(options.
|
|
7
|
+
this.apiService = new hubtype_knowledge_api_service_1.HubtypeApiService(options.host, options.knowledgeBaseId, options.timeout);
|
|
8
8
|
this.authToken = options.authToken || '';
|
|
9
9
|
}
|
|
10
10
|
async pre(_request) {
|
|
11
11
|
return;
|
|
12
12
|
}
|
|
13
13
|
async getInference(session) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const sources = response.data.sources.map(source => {
|
|
18
|
-
return {
|
|
19
|
-
knowledgeSourceId: source.knowledge_source_id,
|
|
20
|
-
page: source.page,
|
|
21
|
-
};
|
|
22
|
-
});
|
|
14
|
+
const authToken = isProd ? session._access_token : this.authToken;
|
|
15
|
+
const response = await this.apiService.inference(authToken, session.user.id);
|
|
16
|
+
const sources = response.data.sources.map(source => {
|
|
23
17
|
return {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
sources,
|
|
18
|
+
knowledgeSourceId: source.knowledge_source_id,
|
|
19
|
+
page: source.page,
|
|
27
20
|
};
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
sources: [],
|
|
35
|
-
};
|
|
36
|
-
}
|
|
21
|
+
});
|
|
22
|
+
return {
|
|
23
|
+
answer: response.data.answer,
|
|
24
|
+
hasKnowledge: response.data.has_knowledge,
|
|
25
|
+
sources,
|
|
26
|
+
};
|
|
37
27
|
}
|
|
38
28
|
}
|
|
39
29
|
exports.default = BotonicPluginKnowledgeBases;
|
package/lib/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;AAEA,mFAAmE;AAGnE,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,CAAA;AAEpD,MAAqB,2BAA2B;IAI9C,YAAY,OAAmC;QAC7C,IAAI,CAAC,UAAU,GAAG,IAAI,iDAAiB,CACrC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;AAEA,mFAAmE;AAGnE,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,CAAA;AAEpD,MAAqB,2BAA2B;IAI9C,YAAY,OAAmC;QAC7C,IAAI,CAAC,UAAU,GAAG,IAAI,iDAAiB,CACrC,OAAO,CAAC,IAAI,EACZ,OAAO,CAAC,eAAe,EACvB,OAAO,CAAC,OAAO,CAChB,CAAA;QACD,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,EAAE,CAAA;IAC1C,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,QAA0B;QAClC,OAAM;IACR,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,OAAuB;QACxC,MAAM,SAAS,GAAG,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAA;QAEjE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;QAE5E,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;YACjD,OAAO;gBACL,iBAAiB,EAAE,MAAM,CAAC,mBAAmB;gBAC7C,IAAI,EAAE,MAAM,CAAC,IAAI;aAClB,CAAA;QACH,CAAC,CAAC,CAAA;QAEF,OAAO;YACL,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,MAAM;YAC5B,YAAY,EAAE,QAAQ,CAAC,IAAI,CAAC,aAAa;YACzC,OAAO;SACR,CAAA;IACH,CAAC;CACF;AAnCD,8CAmCC"}
|
package/lib/cjs/types.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { AxiosResponse } from 'axios';
|
|
2
2
|
export declare class HubtypeApiService {
|
|
3
|
-
private knowledgeBaseId;
|
|
4
3
|
private host;
|
|
4
|
+
private knowledgeBaseId;
|
|
5
5
|
private timeout;
|
|
6
|
-
constructor(
|
|
6
|
+
constructor(host: string, knowledgeBaseId: string, timeout?: number);
|
|
7
7
|
inference(authToken: string, chatId: string): Promise<AxiosResponse<{
|
|
8
|
-
|
|
8
|
+
answer: string;
|
|
9
9
|
has_knowledge: boolean;
|
|
10
10
|
sources: {
|
|
11
11
|
knowledge_source_id: string;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import axios from 'axios';
|
|
3
3
|
const DEFAULT_TIMEOUT = 10000;
|
|
4
4
|
export class HubtypeApiService {
|
|
5
|
-
constructor(
|
|
5
|
+
constructor(host, knowledgeBaseId, timeout) {
|
|
6
6
|
this.knowledgeBaseId = knowledgeBaseId;
|
|
7
7
|
this.host = host;
|
|
8
8
|
this.timeout = timeout || DEFAULT_TIMEOUT;
|
|
@@ -10,12 +10,14 @@ export class HubtypeApiService {
|
|
|
10
10
|
async inference(authToken, chatId) {
|
|
11
11
|
return await axios({
|
|
12
12
|
method: 'POST',
|
|
13
|
-
url: `${this.host}/v1/ai/knowledge_bases/${this.knowledgeBaseId}/inference/`,
|
|
13
|
+
url: `${this.host}/external/v1/ai/knowledge_bases/${this.knowledgeBaseId}/inference/`,
|
|
14
14
|
headers: {
|
|
15
15
|
Authorization: `Bearer ${authToken}`,
|
|
16
16
|
'Content-Type': 'application/json',
|
|
17
17
|
},
|
|
18
|
-
data: {
|
|
18
|
+
data: {
|
|
19
|
+
chat_id: chatId,
|
|
20
|
+
},
|
|
19
21
|
timeout: this.timeout,
|
|
20
22
|
});
|
|
21
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hubtype-knowledge-api-service.js","sourceRoot":"","sources":["../../src/hubtype-knowledge-api-service.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,OAAO,KAAwB,MAAM,OAAO,CAAA;AAE5C,MAAM,eAAe,GAAG,KAAK,CAAA;AAE7B,MAAM,OAAO,iBAAiB;IAK5B,YAAY,
|
|
1
|
+
{"version":3,"file":"hubtype-knowledge-api-service.js","sourceRoot":"","sources":["../../src/hubtype-knowledge-api-service.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,OAAO,KAAwB,MAAM,OAAO,CAAA;AAE5C,MAAM,eAAe,GAAG,KAAK,CAAA;AAE7B,MAAM,OAAO,iBAAiB;IAK5B,YAAY,IAAY,EAAE,eAAuB,EAAE,OAAgB;QACjE,IAAI,CAAC,eAAe,GAAG,eAAe,CAAA;QACtC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,OAAO,GAAG,OAAO,IAAI,eAAe,CAAA;IAC3C,CAAC;IAED,KAAK,CAAC,SAAS,CACb,SAAiB,EACjB,MAAc;QAWd,OAAO,MAAM,KAAK,CAAC;YACjB,MAAM,EAAE,MAAM;YACd,GAAG,EAAE,GAAG,IAAI,CAAC,IAAI,mCAAmC,IAAI,CAAC,eAAe,aAAa;YACrF,OAAO,EAAE;gBACP,aAAa,EAAE,UAAU,SAAS,EAAE;gBACpC,cAAc,EAAE,kBAAkB;aACnC;YACD,IAAI,EAAE;gBACJ,OAAO,EAAE,MAAM;aAChB;YACD,OAAO,EAAE,IAAI,CAAC,OAAO;SACtB,CAAC,CAAA;IACJ,CAAC;CACF"}
|
package/lib/esm/index.js
CHANGED
|
@@ -2,36 +2,26 @@ import { HubtypeApiService } from './hubtype-knowledge-api-service';
|
|
|
2
2
|
const isProd = process.env.NODE_ENV === 'production';
|
|
3
3
|
export default class BotonicPluginKnowledgeBases {
|
|
4
4
|
constructor(options) {
|
|
5
|
-
this.apiService = new HubtypeApiService(options.
|
|
5
|
+
this.apiService = new HubtypeApiService(options.host, options.knowledgeBaseId, options.timeout);
|
|
6
6
|
this.authToken = options.authToken || '';
|
|
7
7
|
}
|
|
8
8
|
async pre(_request) {
|
|
9
9
|
return;
|
|
10
10
|
}
|
|
11
11
|
async getInference(session) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const sources = response.data.sources.map(source => {
|
|
16
|
-
return {
|
|
17
|
-
knowledgeSourceId: source.knowledge_source_id,
|
|
18
|
-
page: source.page,
|
|
19
|
-
};
|
|
20
|
-
});
|
|
12
|
+
const authToken = isProd ? session._access_token : this.authToken;
|
|
13
|
+
const response = await this.apiService.inference(authToken, session.user.id);
|
|
14
|
+
const sources = response.data.sources.map(source => {
|
|
21
15
|
return {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
sources,
|
|
16
|
+
knowledgeSourceId: source.knowledge_source_id,
|
|
17
|
+
page: source.page,
|
|
25
18
|
};
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
sources: [],
|
|
33
|
-
};
|
|
34
|
-
}
|
|
19
|
+
});
|
|
20
|
+
return {
|
|
21
|
+
answer: response.data.answer,
|
|
22
|
+
hasKnowledge: response.data.has_knowledge,
|
|
23
|
+
sources,
|
|
24
|
+
};
|
|
35
25
|
}
|
|
36
26
|
}
|
|
37
27
|
//# sourceMappingURL=index.js.map
|
package/lib/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AAGnE,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,CAAA;AAEpD,MAAM,CAAC,OAAO,OAAO,2BAA2B;IAI9C,YAAY,OAAmC;QAC7C,IAAI,CAAC,UAAU,GAAG,IAAI,iBAAiB,CACrC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AAGnE,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,CAAA;AAEpD,MAAM,CAAC,OAAO,OAAO,2BAA2B;IAI9C,YAAY,OAAmC;QAC7C,IAAI,CAAC,UAAU,GAAG,IAAI,iBAAiB,CACrC,OAAO,CAAC,IAAI,EACZ,OAAO,CAAC,eAAe,EACvB,OAAO,CAAC,OAAO,CAChB,CAAA;QACD,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,EAAE,CAAA;IAC1C,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,QAA0B;QAClC,OAAM;IACR,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,OAAuB;QACxC,MAAM,SAAS,GAAG,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAA;QAEjE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;QAE5E,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;YACjD,OAAO;gBACL,iBAAiB,EAAE,MAAM,CAAC,mBAAmB;gBAC7C,IAAI,EAAE,MAAM,CAAC,IAAI;aAClB,CAAA;QACH,CAAC,CAAC,CAAA;QAEF,OAAO;YACL,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,MAAM;YAC5B,YAAY,EAAE,QAAQ,CAAC,IAAI,CAAC,aAAa;YACzC,OAAO;SACR,CAAA;IACH,CAAC;CACF"}
|
package/lib/esm/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -4,11 +4,11 @@ import axios, { AxiosResponse } from 'axios'
|
|
|
4
4
|
const DEFAULT_TIMEOUT = 10000
|
|
5
5
|
|
|
6
6
|
export class HubtypeApiService {
|
|
7
|
-
private knowledgeBaseId: string
|
|
8
7
|
private host: string
|
|
8
|
+
private knowledgeBaseId: string
|
|
9
9
|
private timeout: number
|
|
10
10
|
|
|
11
|
-
constructor(
|
|
11
|
+
constructor(host: string, knowledgeBaseId: string, timeout?: number) {
|
|
12
12
|
this.knowledgeBaseId = knowledgeBaseId
|
|
13
13
|
this.host = host
|
|
14
14
|
this.timeout = timeout || DEFAULT_TIMEOUT
|
|
@@ -19,7 +19,7 @@ export class HubtypeApiService {
|
|
|
19
19
|
chatId: string
|
|
20
20
|
): Promise<
|
|
21
21
|
AxiosResponse<{
|
|
22
|
-
|
|
22
|
+
answer: string
|
|
23
23
|
has_knowledge: boolean
|
|
24
24
|
sources: {
|
|
25
25
|
knowledge_source_id: string
|
|
@@ -29,12 +29,14 @@ export class HubtypeApiService {
|
|
|
29
29
|
> {
|
|
30
30
|
return await axios({
|
|
31
31
|
method: 'POST',
|
|
32
|
-
url: `${this.host}/v1/ai/knowledge_bases/${this.knowledgeBaseId}/inference/`,
|
|
32
|
+
url: `${this.host}/external/v1/ai/knowledge_bases/${this.knowledgeBaseId}/inference/`,
|
|
33
33
|
headers: {
|
|
34
34
|
Authorization: `Bearer ${authToken}`,
|
|
35
35
|
'Content-Type': 'application/json',
|
|
36
36
|
},
|
|
37
|
-
data: {
|
|
37
|
+
data: {
|
|
38
|
+
chat_id: chatId,
|
|
39
|
+
},
|
|
38
40
|
timeout: this.timeout,
|
|
39
41
|
})
|
|
40
42
|
}
|
package/src/index.ts
CHANGED
|
@@ -11,8 +11,8 @@ export default class BotonicPluginKnowledgeBases implements Plugin {
|
|
|
11
11
|
|
|
12
12
|
constructor(options: PluginKnowledgeBaseOptions) {
|
|
13
13
|
this.apiService = new HubtypeApiService(
|
|
14
|
-
options.knowledgeBaseId,
|
|
15
14
|
options.host,
|
|
15
|
+
options.knowledgeBaseId,
|
|
16
16
|
options.timeout
|
|
17
17
|
)
|
|
18
18
|
this.authToken = options.authToken || ''
|
|
@@ -23,33 +23,21 @@ export default class BotonicPluginKnowledgeBases implements Plugin {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
async getInference(session: HubtypeSession): Promise<KnowledgeBaseResponse> {
|
|
26
|
-
|
|
27
|
-
const authToken = isProd ? session._access_token : this.authToken
|
|
28
|
-
|
|
29
|
-
const response = await this.apiService.inference(
|
|
30
|
-
authToken,
|
|
31
|
-
session.user.id
|
|
32
|
-
)
|
|
26
|
+
const authToken = isProd ? session._access_token : this.authToken
|
|
33
27
|
|
|
34
|
-
|
|
35
|
-
return {
|
|
36
|
-
knowledgeSourceId: source.knowledge_source_id,
|
|
37
|
-
page: source.page,
|
|
38
|
-
}
|
|
39
|
-
})
|
|
28
|
+
const response = await this.apiService.inference(authToken, session.user.id)
|
|
40
29
|
|
|
30
|
+
const sources = response.data.sources.map(source => {
|
|
41
31
|
return {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
sources,
|
|
45
|
-
}
|
|
46
|
-
} catch (e) {
|
|
47
|
-
console.error(e)
|
|
48
|
-
return {
|
|
49
|
-
ai: '',
|
|
50
|
-
hasKnowledge: false,
|
|
51
|
-
sources: [],
|
|
32
|
+
knowledgeSourceId: source.knowledge_source_id,
|
|
33
|
+
page: source.page,
|
|
52
34
|
}
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
return {
|
|
38
|
+
answer: response.data.answer,
|
|
39
|
+
hasKnowledge: response.data.has_knowledge,
|
|
40
|
+
sources,
|
|
53
41
|
}
|
|
54
42
|
}
|
|
55
43
|
}
|