Function
getErrorMessage
(
numActions: number,
apis: Api[] | null,
mockApiResponses: boolean | null,
chatToDocsEnabled: boolean,
)
Source from the content-addressed store, hash-verified
| 239 | } |
| 240 | |
| 241 | function getErrorMessage( |
| 242 | numActions: number, |
| 243 | apis: Api[] | null, |
| 244 | mockApiResponses: boolean | null, |
| 245 | chatToDocsEnabled: boolean, |
| 246 | ): string { |
| 247 | // Error message is delivered in stages so that the user can fix one thing at a time |
| 248 | if (numActions === 0 && !chatToDocsEnabled) |
| 249 | return "You need to add actions (Actions tab)"; |
| 250 | |
| 251 | if ( |
| 252 | apis?.length && |
| 253 | apis.some((api) => !api.api_host) && |
| 254 | !mockApiResponses && |
| 255 | !chatToDocsEnabled |
| 256 | ) |
| 257 | return "You need to add API hosts (Actions tab), or turn on mock API responses."; |
| 258 | |
| 259 | return ""; |
| 260 | } |
Tested by
no test coverage detected