(_question: string)
| 9 | ] |
| 10 | |
| 11 | function chatAnswer(_question: string) { |
| 12 | return { |
| 13 | async *[Symbol.asyncIterator]() { |
| 14 | const answer = answers[Math.floor(Math.random() * answers.length)] |
| 15 | let index = 0 |
| 16 | while (index < answer.length) { |
| 17 | await new Promise((resolve) => |
| 18 | setTimeout(resolve, 100 + Math.random() * 300), |
| 19 | ) |
| 20 | yield answer[index++] |
| 21 | } |
| 22 | }, |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | export const chatQueryOptions = (question: string) => |
| 27 | queryOptions({ |
no outgoing calls
no test coverage detected
searching dependent graphs…