@miso.ai/doggoganger 0.9.0-beta.6 → 0.9.0-beta.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@miso.ai/doggoganger",
3
- "version": "0.9.0-beta.6",
3
+ "version": "0.9.0-beta.7",
4
4
  "description": "A dummy miso endpoint for demo and testing",
5
5
  "type": "module",
6
6
  "bin": {
@@ -10,17 +10,17 @@ const STAGES = [
10
10
  {
11
11
  name: 'fetch',
12
12
  duration: 1.5,
13
- text: `Checking the question and fetching results...`,
13
+ text: `Checking the question and fetching results... `,
14
14
  },
15
15
  {
16
16
  name: 'verify',
17
17
  duration: 1.5,
18
- text: `Verifying results...`,
18
+ text: `Verifying results... `,
19
19
  },
20
20
  {
21
21
  name: 'generate',
22
22
  duration: 1.5,
23
- text: `Generating answer...`,
23
+ text: `Generating answer... `,
24
24
  },
25
25
  ];
26
26
 
@@ -47,7 +47,7 @@ const answers = new Map();
47
47
 
48
48
  class Answer {
49
49
 
50
- constructor(question, previous_question_id, { answerFormat = 'plaintext' } = {}) {
50
+ constructor(question, previous_question_id, { answerFormat = 'markdown' } = {}) {
51
51
  this.question_id = uuid();
52
52
  this.question = question;
53
53
  this.previous_answer_id = previous_question_id;
@@ -65,15 +65,15 @@ class Answer {
65
65
  get() {
66
66
  const now = Date.now();
67
67
  const elapsed = (now - this.timestamp) / 1000;
68
- const [stage, answer, finished] = this._answer(elapsed);
68
+ const [answer_stage, answer, finished] = this._answer(elapsed);
69
69
  const sources = this._sources(elapsed);
70
70
  const related_resources = this._relatedResources(elapsed);
71
71
  const { question_id, question, datetime, previous_question_id } = this;
72
72
 
73
73
  return {
74
74
  affiliation: undefined,
75
- stage,
76
75
  answer,
76
+ answer_stage,
77
77
  datetime,
78
78
  finished,
79
79
  previous_question_id,
package/src/api/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import Router from '@koa/router';
2
- import _answers from './answers.js';
2
+ import ask from './ask.js';
3
3
  import recommendation from './recommendation.js';
4
4
  import search from './search.js';
5
5
  import interactions from './interactions.js';
@@ -11,7 +11,7 @@ function use(router, path, middleware) {
11
11
  export default function(options) {
12
12
  const router = new Router();
13
13
 
14
- use(router, '/answers', _answers(options));
14
+ use(router, '/ask', ask(options));
15
15
  use(router, '/recommendation', recommendation);
16
16
  use(router, '/search', search);
17
17
  use(router, '/interactions', interactions);
@@ -126,6 +126,7 @@ const INLINE_FEATURES = {
126
126
  'emphasis-1': () => multiply(_emphasisAdfix(1), 2),
127
127
  'emphasis-2': () => multiply(_emphasisAdfix(2), 2),
128
128
  'emphasis-3': () => multiply(_emphasisAdfix(3), 2),
129
+ 'strikethrough': () => ['~', '~'],
129
130
  'link': ({ url = 'https://miso.ai' } = {}) => [`[`, `](${url})`],
130
131
  };
131
132