@digipair/skill-chatbot 0.19.4 → 0.20.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/index.cjs.js CHANGED
@@ -7,6 +7,7 @@ require('@digipair/engine');
7
7
 
8
8
 
9
9
 
10
+ exports.answer = index.answer;
10
11
  exports.boost = index.boost;
11
12
  exports.chatbot = index.chatbot;
12
13
  exports.find = index.find;
package/index.cjs2.js CHANGED
@@ -47464,6 +47464,16 @@ Summarize the conversation history in a short, clear and concise text, taking in
47464
47464
  document
47465
47465
  ]);
47466
47466
  }
47467
+ async answer(params, _pinsSettingsList, context) {
47468
+ const { command = [], boosts = [], assistant, sources, logs } = params;
47469
+ return {
47470
+ assistant,
47471
+ command: await Promise.all(command.map((settings)=>engine.preparePinsSettings(settings, context))),
47472
+ boosts,
47473
+ sources,
47474
+ logs
47475
+ };
47476
+ }
47467
47477
  };
47468
47478
  const history = (params, pinsSettingsList, context)=>new ChatbotService().history(params, pinsSettingsList, context);
47469
47479
  const find = (params, pinsSettingsList, context)=>new ChatbotService().find(params, pinsSettingsList, context);
@@ -47472,11 +47482,13 @@ const chatbot = (params, pinsSettingsList, context)=>new ChatbotService().chatbo
47472
47482
  const boost = (params, pinsSettingsList, context)=>new ChatbotService().boost(params, pinsSettingsList, context);
47473
47483
  const getRole = (params, pinsSettingsList, context)=>new ChatbotService().getRole(params, pinsSettingsList, context);
47474
47484
  const setRole = (params, pinsSettingsList, context)=>new ChatbotService().setRole(params, pinsSettingsList, context);
47485
+ const answer = (params, pinsSettingsList, context)=>new ChatbotService().answer(params, pinsSettingsList, context);
47475
47486
 
47476
47487
  exports.BasePromptTemplate = BasePromptTemplate;
47477
47488
  exports.BaseStringPromptTemplate = BaseStringPromptTemplate;
47478
47489
  exports.ChatPromptValue = ChatPromptValue;
47479
47490
  exports.PromptTemplate = PromptTemplate;
47491
+ exports.answer = answer;
47480
47492
  exports.boost = boost;
47481
47493
  exports.chatbot = chatbot;
47482
47494
  exports.checkValidTemplate = checkValidTemplate;
package/index.esm.js CHANGED
@@ -1,2 +1,2 @@
1
- export { d as boost, b as chatbot, f as find, g as getRole, h as history, s as search, e as setRole } from './index.esm2.js';
1
+ export { i as answer, d as boost, b as chatbot, f as find, g as getRole, h as history, s as search, e as setRole } from './index.esm2.js';
2
2
  import '@digipair/engine';
package/index.esm2.js CHANGED
@@ -47462,6 +47462,16 @@ Summarize the conversation history in a short, clear and concise text, taking in
47462
47462
  document
47463
47463
  ]);
47464
47464
  }
47465
+ async answer(params, _pinsSettingsList, context) {
47466
+ const { command = [], boosts = [], assistant, sources, logs } = params;
47467
+ return {
47468
+ assistant,
47469
+ command: await Promise.all(command.map((settings)=>preparePinsSettings(settings, context))),
47470
+ boosts,
47471
+ sources,
47472
+ logs
47473
+ };
47474
+ }
47465
47475
  };
47466
47476
  const history = (params, pinsSettingsList, context)=>new ChatbotService().history(params, pinsSettingsList, context);
47467
47477
  const find = (params, pinsSettingsList, context)=>new ChatbotService().find(params, pinsSettingsList, context);
@@ -47470,5 +47480,6 @@ const chatbot = (params, pinsSettingsList, context)=>new ChatbotService().chatbo
47470
47480
  const boost = (params, pinsSettingsList, context)=>new ChatbotService().boost(params, pinsSettingsList, context);
47471
47481
  const getRole = (params, pinsSettingsList, context)=>new ChatbotService().getRole(params, pinsSettingsList, context);
47472
47482
  const setRole = (params, pinsSettingsList, context)=>new ChatbotService().setRole(params, pinsSettingsList, context);
47483
+ const answer = (params, pinsSettingsList, context)=>new ChatbotService().answer(params, pinsSettingsList, context);
47473
47484
 
47474
- export { BasePromptTemplate as B, ChatPromptValue as C, PromptTemplate as P, BaseStringPromptTemplate as a, chatbot as b, checkValidTemplate as c, boost as d, setRole as e, find as f, getRole as g, history as h, renderTemplate as r, search as s };
47485
+ export { BasePromptTemplate as B, ChatPromptValue as C, PromptTemplate as P, BaseStringPromptTemplate as a, chatbot as b, checkValidTemplate as c, boost as d, setRole as e, find as f, getRole as g, history as h, answer as i, renderTemplate as r, search as s };
@@ -12,3 +12,10 @@ export declare const chatbot: (params: any, pinsSettingsList: PinsSettings[], co
12
12
  export declare const boost: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
13
13
  export declare const getRole: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
14
14
  export declare const setRole: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<void>;
15
+ export declare const answer: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<{
16
+ assistant: any;
17
+ command: any[];
18
+ boosts: any;
19
+ sources: any;
20
+ logs: any;
21
+ }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digipair/skill-chatbot",
3
- "version": "0.19.4",
3
+ "version": "0.20.1",
4
4
  "dependencies": {},
5
5
  "typings": "./index.d.ts",
6
6
  "main": "./index.cjs.js",
package/schema.json CHANGED
@@ -323,6 +323,61 @@
323
323
  ],
324
324
  "x-events": []
325
325
  }
326
+ },
327
+ "/answer": {
328
+ "post": {
329
+ "tags": ["boost"],
330
+ "summary": "Réponse du chatbot",
331
+ "parameters": [
332
+ {
333
+ "name": "assistant",
334
+ "required": true,
335
+ "description": "Reponse de l'assistant",
336
+ "schema": {
337
+ "type": "string"
338
+ }
339
+ },
340
+ {
341
+ "name": "command",
342
+ "required": false,
343
+ "description": "Commandes exécutées sur le chatbot",
344
+ "schema": {
345
+ "type": "array",
346
+ "items": {
347
+ "$ref": "https://schemas.digipair.ai/pinsSettings"
348
+ }
349
+ }
350
+ },
351
+ {
352
+ "name": "boosts",
353
+ "required": false,
354
+ "description": "Liste des boosts proposés",
355
+ "schema": {
356
+ "type": "object"
357
+ }
358
+ },
359
+ {
360
+ "name": "sources",
361
+ "required": false,
362
+ "description": "Liste des sources utilisées pour répondre a l'utilisateur",
363
+ "schema": {
364
+ "type": "array",
365
+ "items": {
366
+ "type": "object"
367
+ }
368
+ }
369
+ },
370
+ {
371
+ "name": "logs",
372
+ "required": false,
373
+ "description": "Informations utiles pour débogguer le raisonnement",
374
+ "schema": {
375
+ "type": "object"
376
+ }
377
+ }
378
+ ],
379
+ "x-events": []
380
+ }
326
381
  }
327
382
  },
328
383
  "components": {