@tiledesk/tiledesk-tybot-connector 2.0.10-rc7 → 2.0.10-rc8

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/logs/app.log CHANGED
@@ -3750,3 +3750,583 @@ error: Axios error response data: {"error":"no knowledge base settings found"}
3750
3750
  error: DirAskGPTV2 Get kb settings error {"error":"no knowledge base settings found"}
3751
3751
  info: DirAskGPTV2 Error: gptkey is mandatory
3752
3752
  error: DirAskGPTV2 Error: question attribute is mandatory. Executing condition false...
3753
+ info: Starting tilebot server...
3754
+ info: (Tilebot) Starting Tilebot..
3755
+ info: (Tilebot) settings.API_ENDPOINT:http://localhost:10002
3756
+ info: (Tilebot) settings.TILEBOT_ENDPOINT:http://localhost:10001
3757
+ info: (Tilebot) Log Level: info
3758
+ info: (Tilebot) MAX_STEPS: 1000
3759
+ info: (Tilebot) MAX_EXECUTION_TIME: 28800000
3760
+ info: (Tilebot) Starting Tilebot connector v2.0.10-rc7
3761
+ info: (Tilebot) Using static bots
3762
+ info: (Tilebot) Connecting Redis...
3763
+ info: (Tilebot) Redis connected
3764
+ info: (Tilebot) Tilebot started
3765
+ info: Tilebot route successfully started.
3766
+ info: Tilebot connector listening on port...
3767
+ info: Starting tilebot server...
3768
+ info: (Tilebot) Starting Tilebot..
3769
+ info: (Tilebot) settings.API_ENDPOINT:http://localhost:10002
3770
+ info: (Tilebot) settings.TILEBOT_ENDPOINT:http://localhost:10001
3771
+ info: (Tilebot) Log Level: info
3772
+ info: (Tilebot) MAX_STEPS: 1000
3773
+ info: (Tilebot) MAX_EXECUTION_TIME: 28800000
3774
+ info: (Tilebot) Starting Tilebot connector v2.0.10-rc7
3775
+ info: (Tilebot) Using static bots
3776
+ info: (Tilebot) Connecting Redis...
3777
+ info: (Tilebot) Redis connected
3778
+ info: (Tilebot) Tilebot started
3779
+ info: Tilebot route successfully started.
3780
+ info: Tilebot connector listening on port
3781
+ info: Starting tilebot server...
3782
+ info: (Tilebot) Starting Tilebot..
3783
+ info: (Tilebot) settings.API_ENDPOINT:http://localhost:10002
3784
+ info: (Tilebot) settings.TILEBOT_ENDPOINT:http://localhost:10001
3785
+ info: (Tilebot) Log Level: info
3786
+ info: (Tilebot) MAX_STEPS: 1000
3787
+ info: (Tilebot) MAX_EXECUTION_TIME: 28800000
3788
+ info: (Tilebot) Starting Tilebot connector v2.0.10-rc7
3789
+ info: (Tilebot) Using static bots
3790
+ info: (Tilebot) Connecting Redis...
3791
+ info: (Tilebot) Redis connected
3792
+ info: (Tilebot) Tilebot started
3793
+ info: Tilebot route successfully started.
3794
+ info: Tilebot connector listening on port
3795
+ error: Axios error response data: Integration not found for model undefined
3796
+ error: Error: DirAiPrompt llm key not found in integrations
3797
+ error: Axios error response data: {"detail":[{"loc":["string",0],"msg":"this is the error message","type":"string"}]}
3798
+ error: DirAiPrompt openai err: Request failed with status code 422 {"code":"ERR_BAD_REQUEST","config":{"adapter":["xhr","http","fetch"],"data":"{\"question\":\"this is the question\",\"llm\":\"myllm\",\"model\":\"llmmodel\",\"llm_key\":\"example_api_key\",\"temperature\":0.7,\"max_tokens\":512}","env":{"Blob":null},"headers":{"Accept":"application/json, text/plain, */*","Accept-Encoding":"gzip, compress, deflate, br","Content-Length":"131","Content-Type":"application/json","User-Agent":"axios/1.7.7"},"maxBodyLength":-1,"maxContentLength":-1,"method":"post","timeout":0,"transformRequest":[null],"transformResponse":[null],"transitional":{"clarifyTimeoutError":false,"forcedJSONParsing":true,"silentJSONParsing":true},"url":"http://localhost:10002/api/ask","xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN"},"name":"AxiosError","request":{"_closed":false,"_contentLength":null,"_defaultKeepAlive":true,"_ended":true,"_events":{},"_eventsCount":7,"_hasBody":true,"_header":"POST /api/ask HTTP/1.1\r\nAccept: application/json, text/plain, */*\r\nContent-Type: application/json\r\nUser-Agent: axios/1.7.7\r\nContent-Length: 131\r\nAccept-Encoding: gzip, compress, deflate, br\r\nHost: localhost:10002\r\nConnection: close\r\n\r\n","_headerSent":true,"_keepAliveTimeout":0,"_last":true,"_redirectable":{"_currentRequest":"[Circular]","_currentUrl":"http://localhost:10002/api/ask","_ended":true,"_ending":true,"_events":{},"_eventsCount":3,"_options":{"agents":{},"beforeRedirects":{},"headers":{"Accept":"application/json, text/plain, */*","Accept-Encoding":"gzip, compress, deflate, br","Content-Length":"131","Content-Type":"application/json","User-Agent":"axios/1.7.7"},"hostname":"localhost","maxBodyLength":null,"maxRedirects":21,"method":"POST","nativeProtocols":{"http:":{"METHODS":["ACL","BIND","CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LINK","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCALENDAR","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REBIND","REPORT","SEARCH","SOURCE","SUBSCRIBE","TRACE","UNBIND","UNLINK","UNLOCK","UNSUBSCRIBE"],"STATUS_CODES":{"100":"Continue","101":"Switching Protocols","102":"Processing","103":"Early Hints","200":"OK","201":"Created","202":"Accepted","203":"Non-Authoritative Information","204":"No Content","205":"Reset Content","206":"Partial Content","207":"Multi-Status","208":"Already Reported","226":"IM Used","300":"Multiple Choices","301":"Moved Permanently","302":"Found","303":"See Other","304":"Not Modified","305":"Use Proxy","307":"Temporary Redirect","308":"Permanent Redirect","400":"Bad Request","401":"Unauthorized","402":"Payment Required","403":"Forbidden","404":"Not Found","405":"Method Not Allowed","406":"Not Acceptable","407":"Proxy Authentication Required","408":"Request Timeout","409":"Conflict","410":"Gone","411":"Length Required","412":"Precondition Failed","413":"Payload Too Large","414":"URI Too Long","415":"Unsupported Media Type","416":"Range Not Satisfiable","417":"Expectation Failed","418":"I'm a Teapot","421":"Misdirected Request","422":"Unprocessable Entity","423":"Locked","424":"Failed Dependency","425":"Too Early","426":"Upgrade Required","428":"Precondition Required","429":"Too Many Requests","431":"Request Header Fields Too Large","451":"Unavailable For Legal Reasons","500":"Internal Server Error","501":"Not Implemented","502":"Bad Gateway","503":"Service Unavailable","504":"Gateway Timeout","505":"HTTP Version Not Supported","506":"Variant Also Negotiates","507":"Insufficient Storage","508":"Loop Detected","509":"Bandwidth Limit Exceeded","510":"Not Extended","511":"Network Authentication Required"},"globalAgent":{"_events":{},"_eventsCount":2,"defaultPort":80,"freeSockets":{},"keepAlive":false,"keepAliveMsecs":1000,"maxFreeSockets":256,"maxSockets":null,"maxTotalSockets":null,"options":{"path":null},"protocol":"http:","requests":{},"scheduling":"lifo","sockets":{"localhost:10002:":[{"_events":{"close":[null,null]},"_eventsCount":7,"_hadError":false,"_host":"localhost","_httpMessage":"[Circular]","_parent":null,"_pendingData":null,"_pendingEncoding":"","_readableState":{"autoDestroy":true,"awaitDrainWriters":null,"buffer":{"head":null,"length":0,"tail":null},"closeEmitted":false,"closed":false,"constructed":true,"dataEmitted":true,"decoder":null,"defaultEncoding":"utf8","destroyed":false,"emitClose":false,"emittedReadable":false,"encoding":null,"endEmitted":false,"ended":false,"errorEmitted":false,"errored":null,"flowing":true,"highWaterMark":16384,"length":0,"multiAwaitDrain":false,"needReadable":true,"objectMode":false,"pipes":[],"readableListening":false,"reading":true,"readingMore":false,"resumeScheduled":false,"sync":false},"_server":null,"_sockname":null,"_writableState":{"afterWriteTickInfo":null,"allBuffers":true,"allNoop":true,"autoDestroy":true,"bufferProcessing":false,"buffered":[],"bufferedIndex":0,"closeEmitted":false,"closed":false,"constructed":true,"corked":0,"decodeStrings":false,"defaultEncoding":"utf8","destroyed":false,"emitClose":false,"ended":true,"ending":true,"errorEmitted":false,"errored":null,"finalCalled":true,"finished":false,"highWaterMark":16384,"length":0,"needDrain":false,"objectMode":false,"pendingcb":1,"prefinished":false,"sync":false,"writecb":null,"writelen":0,"writing":false},"allowHalfOpen":false,"connecting":false,"parser":null,"server":null}]},"totalSocketCount":1},"maxHeaderSize":16384},"https:":{"globalAgent":{"_events":{},"_eventsCount":2,"_sessionCache":{"list":[],"map":{}},"defaultPort":443,"freeSockets":{},"keepAlive":false,"keepAliveMsecs":1000,"maxCachedSessions":100,"maxFreeSockets":256,"maxSockets":null,"maxTotalSockets":null,"options":{"path":null},"protocol":"https:","requests":{},"scheduling":"lifo","sockets":{},"totalSocketCount":0}}},"path":"/api/ask","pathname":"/api/ask","port":"10002","protocol":"http:"},"_redirectCount":0,"_redirects":[],"_requestBodyBuffers":[],"_requestBodyLength":131,"_writableState":{"afterWriteTickInfo":null,"allBuffers":true,"allNoop":true,"autoDestroy":true,"bufferProcessing":false,"buffered":[],"bufferedIndex":0,"closeEmitted":false,"closed":false,"constructed":true,"corked":0,"decodeStrings":true,"defaultEncoding":"utf8","destroyed":false,"emitClose":true,"ended":false,"ending":false,"errorEmitted":false,"errored":null,"finalCalled":false,"finished":false,"highWaterMark":16384,"length":0,"needDrain":false,"objectMode":false,"pendingcb":0,"prefinished":false,"sync":true,"writecb":null,"writelen":0,"writing":false}},"_removedConnection":false,"_removedContLen":false,"_removedTE":false,"_trailer":"","aborted":false,"agent":{"_events":{},"_eventsCount":2,"defaultPort":80,"freeSockets":{},"keepAlive":false,"keepAliveMsecs":1000,"maxFreeSockets":256,"maxSockets":null,"maxTotalSockets":null,"options":{"path":null},"protocol":"http:","requests":{},"scheduling":"lifo","sockets":{"localhost:10002:":[{"_events":{"close":[null,null]},"_eventsCount":7,"_hadError":false,"_host":"localhost","_httpMessage":"[Circular]","_parent":null,"_pendingData":null,"_pendingEncoding":"","_readableState":{"autoDestroy":true,"awaitDrainWriters":null,"buffer":{"head":null,"length":0,"tail":null},"closeEmitted":false,"closed":false,"constructed":true,"dataEmitted":true,"decoder":null,"defaultEncoding":"utf8","destroyed":false,"emitClose":false,"emittedReadable":false,"encoding":null,"endEmitted":false,"ended":false,"errorEmitted":false,"errored":null,"flowing":true,"highWaterMark":16384,"length":0,"multiAwaitDrain":false,"needReadable":true,"objectMode":false,"pipes":[],"readableListening":false,"reading":true,"readingMore":false,"resumeScheduled":false,"sync":false},"_server":null,"_sockname":null,"_writableState":{"afterWriteTickInfo":null,"allBuffers":true,"allNoop":true,"autoDestroy":true,"bufferProcessing":false,"buffered":[],"bufferedIndex":0,"closeEmitted":false,"closed":false,"constructed":true,"corked":0,"decodeStrings":false,"defaultEncoding":"utf8","destroyed":false,"emitClose":false,"ended":true,"ending":true,"errorEmitted":false,"errored":null,"finalCalled":true,"finished":false,"highWaterMark":16384,"length":0,"needDrain":false,"objectMode":false,"pendingcb":1,"prefinished":false,"sync":false,"writecb":null,"writelen":0,"writing":false},"allowHalfOpen":false,"connecting":false,"parser":null,"server":null}]},"totalSocketCount":1},"chunkedEncoding":false,"destroyed":false,"finished":true,"host":"localhost","maxHeadersCount":null,"maxRequestsOnConnectionReached":false,"method":"POST","outputData":[],"outputSize":0,"parser":null,"path":"/api/ask","protocol":"http:","res":{"_consuming":false,"_dumped":false,"_events":{"end":[null,null]},"_eventsCount":4,"_readableState":{"autoDestroy":true,"awaitDrainWriters":null,"buffer":{"head":null,"length":0,"tail":null},"closeEmitted":true,"closed":true,"constructed":true,"dataEmitted":true,"decoder":null,"defaultEncoding":"utf8","destroyed":true,"emitClose":true,"emittedReadable":false,"encoding":null,"endEmitted":true,"ended":true,"errorEmitted":false,"errored":null,"flowing":true,"highWaterMark":16384,"length":0,"multiAwaitDrain":false,"needReadable":false,"objectMode":false,"pipes":[],"readableListening":false,"reading":false,"readingMore":true,"resumeScheduled":false,"sync":true},"aborted":false,"client":{"_events":{"close":[null,null]},"_eventsCount":7,"_hadError":false,"_host":"localhost","_httpMessage":"[Circular]","_parent":null,"_pendingData":null,"_pendingEncoding":"","_readableState":{"autoDestroy":true,"awaitDrainWriters":null,"buffer":{"head":null,"length":0,"tail":null},"closeEmitted":false,"closed":false,"constructed":true,"dataEmitted":true,"decoder":null,"defaultEncoding":"utf8","destroyed":false,"emitClose":false,"emittedReadable":false,"encoding":null,"endEmitted":false,"ended":false,"errorEmitted":false,"errored":null,"flowing":true,"highWaterMark":16384,"length":0,"multiAwaitDrain":false,"needReadable":true,"objectMode":false,"pipes":[],"readableListening":false,"reading":true,"readingMore":false,"resumeScheduled":false,"sync":false},"_server":null,"_sockname":null,"_writableState":{"afterWriteTickInfo":null,"allBuffers":true,"allNoop":true,"autoDestroy":true,"bufferProcessing":false,"buffered":[],"bufferedIndex":0,"closeEmitted":false,"closed":false,"constructed":true,"corked":0,"decodeStrings":false,"defaultEncoding":"utf8","destroyed":false,"emitClose":false,"ended":true,"ending":true,"errorEmitted":false,"errored":null,"finalCalled":true,"finished":false,"highWaterMark":16384,"length":0,"needDrain":false,"objectMode":false,"pendingcb":1,"prefinished":false,"sync":false,"writecb":null,"writelen":0,"writing":false},"allowHalfOpen":false,"connecting":false,"parser":null,"server":null},"complete":true,"httpVersion":"1.1","httpVersionMajor":1,"httpVersionMinor":1,"method":null,"rawHeaders":["X-Powered-By","Express","Content-Type","application/json; charset=utf-8","Content-Length","83","ETag","W/\"53-r1gE0xIC+8fgNRuH768xfjuFcI8\"","Date","Tue, 22 Apr 2025 15:44:24 GMT","Connection","close"],"rawTrailers":[],"redirects":[],"req":"[Circular]","responseUrl":"http://localhost:10002/api/ask","socket":{"_events":{"close":[null,null]},"_eventsCount":7,"_hadError":false,"_host":"localhost","_httpMessage":"[Circular]","_parent":null,"_pendingData":null,"_pendingEncoding":"","_readableState":{"autoDestroy":true,"awaitDrainWriters":null,"buffer":{"head":null,"length":0,"tail":null},"closeEmitted":false,"closed":false,"constructed":true,"dataEmitted":true,"decoder":null,"defaultEncoding":"utf8","destroyed":false,"emitClose":false,"emittedReadable":false,"encoding":null,"endEmitted":false,"ended":false,"errorEmitted":false,"errored":null,"flowing":true,"highWaterMark":16384,"length":0,"multiAwaitDrain":false,"needReadable":true,"objectMode":false,"pipes":[],"readableListening":false,"reading":true,"readingMore":false,"resumeScheduled":false,"sync":false},"_server":null,"_sockname":null,"_writableState":{"afterWriteTickInfo":null,"allBuffers":true,"allNoop":true,"autoDestroy":true,"bufferProcessing":false,"buffered":[],"bufferedIndex":0,"closeEmitted":false,"closed":false,"constructed":true,"corked":0,"decodeStrings":false,"defaultEncoding":"utf8","destroyed":false,"emitClose":false,"ended":true,"ending":true,"errorEmitted":false,"errored":null,"finalCalled":true,"finished":false,"highWaterMark":16384,"length":0,"needDrain":false,"objectMode":false,"pendingcb":1,"prefinished":false,"sync":false,"writecb":null,"writelen":0,"writing":false},"allowHalfOpen":false,"connecting":false,"parser":null,"server":null},"statusCode":422,"statusMessage":"Unprocessable Entity","upgrade":false,"url":""},"reusedSocket":false,"sendDate":false,"shouldKeepAlive":false,"socket":{"_events":{"close":[null,null]},"_eventsCount":7,"_hadError":false,"_host":"localhost","_httpMessage":"[Circular]","_parent":null,"_pendingData":null,"_pendingEncoding":"","_readableState":{"autoDestroy":true,"awaitDrainWriters":null,"buffer":{"head":null,"length":0,"tail":null},"closeEmitted":false,"closed":false,"constructed":true,"dataEmitted":true,"decoder":null,"defaultEncoding":"utf8","destroyed":false,"emitClose":false,"emittedReadable":false,"encoding":null,"endEmitted":false,"ended":false,"errorEmitted":false,"errored":null,"flowing":true,"highWaterMark":16384,"length":0,"multiAwaitDrain":false,"needReadable":true,"objectMode":false,"pipes":[],"readableListening":false,"reading":true,"readingMore":false,"resumeScheduled":false,"sync":false},"_server":null,"_sockname":null,"_writableState":{"afterWriteTickInfo":null,"allBuffers":true,"allNoop":true,"autoDestroy":true,"bufferProcessing":false,"buffered":[],"bufferedIndex":0,"closeEmitted":false,"closed":false,"constructed":true,"corked":0,"decodeStrings":false,"defaultEncoding":"utf8","destroyed":false,"emitClose":false,"ended":true,"ending":true,"errorEmitted":false,"errored":null,"finalCalled":true,"finished":false,"highWaterMark":16384,"length":0,"needDrain":false,"objectMode":false,"pendingcb":1,"prefinished":false,"sync":false,"writecb":null,"writelen":0,"writing":false},"allowHalfOpen":false,"connecting":false,"parser":null,"server":null},"timeoutCb":null,"upgradeOrConnect":false,"useChunkedEncodingByDefault":true,"writable":true},"response":{"config":{"adapter":["xhr","http","fetch"],"data":"{\"question\":\"this is the question\",\"llm\":\"myllm\",\"model\":\"llmmodel\",\"llm_key\":\"example_api_key\",\"temperature\":0.7,\"max_tokens\":512}","env":{"Blob":null},"headers":{"Accept":"application/json, text/plain, */*","Accept-Encoding":"gzip, compress, deflate, br","Content-Length":"131","Content-Type":"application/json","User-Agent":"axios/1.7.7"},"maxBodyLength":-1,"maxContentLength":-1,"method":"post","timeout":0,"transformRequest":[null],"transformResponse":[null],"transitional":{"clarifyTimeoutError":false,"forcedJSONParsing":true,"silentJSONParsing":true},"url":"http://localhost:10002/api/ask","xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN"},"data":{"detail":[{"loc":["string",0],"msg":"this is the error message","type":"string"}]},"headers":{"connection":"close","content-length":"83","content-type":"application/json; charset=utf-8","date":"Tue, 22 Apr 2025 15:44:24 GMT","etag":"W/\"53-r1gE0xIC+8fgNRuH768xfjuFcI8\"","x-powered-by":"Express"},"request":{"_closed":false,"_contentLength":null,"_defaultKeepAlive":true,"_ended":true,"_events":{},"_eventsCount":7,"_hasBody":true,"_header":"POST /api/ask HTTP/1.1\r\nAccept: application/json, text/plain, */*\r\nContent-Type: application/json\r\nUser-Agent: axios/1.7.7\r\nContent-Length: 131\r\nAccept-Encoding: gzip, compress, deflate, br\r\nHost: localhost:10002\r\nConnection: close\r\n\r\n","_headerSent":true,"_keepAliveTimeout":0,"_last":true,"_redirectable":{"_currentRequest":"[Circular]","_currentUrl":"http://localhost:10002/api/ask","_ended":true,"_ending":true,"_events":{},"_eventsCount":3,"_options":{"agents":{},"beforeRedirects":{},"headers":{"Accept":"application/json, text/plain, */*","Accept-Encoding":"gzip, compress, deflate, br","Content-Length":"131","Content-Type":"application/json","User-Agent":"axios/1.7.7"},"hostname":"localhost","maxBodyLength":null,"maxRedirects":21,"method":"POST","nativeProtocols":{"http:":{"METHODS":["ACL","BIND","CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LINK","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCALENDAR","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REBIND","REPORT","SEARCH","SOURCE","SUBSCRIBE","TRACE","UNBIND","UNLINK","UNLOCK","UNSUBSCRIBE"],"STATUS_CODES":{"100":"Continue","101":"Switching Protocols","102":"Processing","103":"Early Hints","200":"OK","201":"Created","202":"Accepted","203":"Non-Authoritative Information","204":"No Content","205":"Reset Content","206":"Partial Content","207":"Multi-Status","208":"Already Reported","226":"IM Used","300":"Multiple Choices","301":"Moved Permanently","302":"Found","303":"See Other","304":"Not Modified","305":"Use Proxy","307":"Temporary Redirect","308":"Permanent Redirect","400":"Bad Request","401":"Unauthorized","402":"Payment Required","403":"Forbidden","404":"Not Found","405":"Method Not Allowed","406":"Not Acceptable","407":"Proxy Authentication Required","408":"Request Timeout","409":"Conflict","410":"Gone","411":"Length Required","412":"Precondition Failed","413":"Payload Too Large","414":"URI Too Long","415":"Unsupported Media Type","416":"Range Not Satisfiable","417":"Expectation Failed","418":"I'm a Teapot","421":"Misdirected Request","422":"Unprocessable Entity","423":"Locked","424":"Failed Dependency","425":"Too Early","426":"Upgrade Required","428":"Precondition Required","429":"Too Many Requests","431":"Request Header Fields Too Large","451":"Unavailable For Legal Reasons","500":"Internal Server Error","501":"Not Implemented","502":"Bad Gateway","503":"Service Unavailable","504":"Gateway Timeout","505":"HTTP Version Not Supported","506":"Variant Also Negotiates","507":"Insufficient Storage","508":"Loop Detected","509":"Bandwidth Limit Exceeded","510":"Not Extended","511":"Network Authentication Required"},"globalAgent":{"_events":{},"_eventsCount":2,"defaultPort":80,"freeSockets":{},"keepAlive":false,"keepAliveMsecs":1000,"maxFreeSockets":256,"maxSockets":null,"maxTotalSockets":null,"options":{"path":null},"protocol":"http:","requests":{},"scheduling":"lifo","sockets":{"localhost:10002:":[{"_events":{"close":[null,null]},"_eventsCount":7,"_hadError":false,"_host":"localhost","_httpMessage":"[Circular]","_parent":null,"_pendingData":null,"_pendingEncoding":"","_readableState":{"autoDestroy":true,"awaitDrainWriters":null,"buffer":{"head":null,"length":0,"tail":null},"closeEmitted":false,"closed":false,"constructed":true,"dataEmitted":true,"decoder":null,"defaultEncoding":"utf8","destroyed":false,"emitClose":false,"emittedReadable":false,"encoding":null,"endEmitted":false,"ended":false,"errorEmitted":false,"errored":null,"flowing":true,"highWaterMark":16384,"length":0,"multiAwaitDrain":false,"needReadable":true,"objectMode":false,"pipes":[],"readableListening":false,"reading":true,"readingMore":false,"resumeScheduled":false,"sync":false},"_server":null,"_sockname":null,"_writableState":{"afterWriteTickInfo":null,"allBuffers":true,"allNoop":true,"autoDestroy":true,"bufferProcessing":false,"buffered":[],"bufferedIndex":0,"closeEmitted":false,"closed":false,"constructed":true,"corked":0,"decodeStrings":false,"defaultEncoding":"utf8","destroyed":false,"emitClose":false,"ended":true,"ending":true,"errorEmitted":false,"errored":null,"finalCalled":true,"finished":false,"highWaterMark":16384,"length":0,"needDrain":false,"objectMode":false,"pendingcb":1,"prefinished":false,"sync":false,"writecb":null,"writelen":0,"writing":false},"allowHalfOpen":false,"connecting":false,"parser":null,"server":null}]},"totalSocketCount":1},"maxHeaderSize":16384},"https:":{"globalAgent":{"_events":{},"_eventsCount":2,"_sessionCache":{"list":[],"map":{}},"defaultPort":443,"freeSockets":{},"keepAlive":false,"keepAliveMsecs":1000,"maxCachedSessions":100,"maxFreeSockets":256,"maxSockets":null,"maxTotalSockets":null,"options":{"path":null},"protocol":"https:","requests":{},"scheduling":"lifo","sockets":{},"totalSocketCount":0}}},"path":"/api/ask","pathname":"/api/ask","port":"10002","protocol":"http:"},"_redirectCount":0,"_redirects":[],"_requestBodyBuffers":[],"_requestBodyLength":131,"_writableState":{"afterWriteTickInfo":null,"allBuffers":true,"allNoop":true,"autoDestroy":true,"bufferProcessing":false,"buffered":[],"bufferedIndex":0,"closeEmitted":false,"closed":false,"constructed":true,"corked":0,"decodeStrings":true,"defaultEncoding":"utf8","destroyed":false,"emitClose":true,"ended":false,"ending":false,"errorEmitted":false,"errored":null,"finalCalled":false,"finished":false,"highWaterMark":16384,"length":0,"needDrain":false,"objectMode":false,"pendingcb":0,"prefinished":false,"sync":true,"writecb":null,"writelen":0,"writing":false}},"_removedConnection":false,"_removedContLen":false,"_removedTE":false,"_trailer":"","aborted":false,"agent":{"_events":{},"_eventsCount":2,"defaultPort":80,"freeSockets":{},"keepAlive":false,"keepAliveMsecs":1000,"maxFreeSockets":256,"maxSockets":null,"maxTotalSockets":null,"options":{"path":null},"protocol":"http:","requests":{},"scheduling":"lifo","sockets":{"localhost:10002:":[{"_events":{"close":[null,null]},"_eventsCount":7,"_hadError":false,"_host":"localhost","_httpMessage":"[Circular]","_parent":null,"_pendingData":null,"_pendingEncoding":"","_readableState":{"autoDestroy":true,"awaitDrainWriters":null,"buffer":{"head":null,"length":0,"tail":null},"closeEmitted":false,"closed":false,"constructed":true,"dataEmitted":true,"decoder":null,"defaultEncoding":"utf8","destroyed":false,"emitClose":false,"emittedReadable":false,"encoding":null,"endEmitted":false,"ended":false,"errorEmitted":false,"errored":null,"flowing":true,"highWaterMark":16384,"length":0,"multiAwaitDrain":false,"needReadable":true,"objectMode":false,"pipes":[],"readableListening":false,"reading":true,"readingMore":false,"resumeScheduled":false,"sync":false},"_server":null,"_sockname":null,"_writableState":{"afterWriteTickInfo":null,"allBuffers":true,"allNoop":true,"autoDestroy":true,"bufferProcessing":false,"buffered":[],"bufferedIndex":0,"closeEmitted":false,"closed":false,"constructed":true,"corked":0,"decodeStrings":false,"defaultEncoding":"utf8","destroyed":false,"emitClose":false,"ended":true,"ending":true,"errorEmitted":false,"errored":null,"finalCalled":true,"finished":false,"highWaterMark":16384,"length":0,"needDrain":false,"objectMode":false,"pendingcb":1,"prefinished":false,"sync":false,"writecb":null,"writelen":0,"writing":false},"allowHalfOpen":false,"connecting":false,"parser":null,"server":null}]},"totalSocketCount":1},"chunkedEncoding":false,"destroyed":false,"finished":true,"host":"localhost","maxHeadersCount":null,"maxRequestsOnConnectionReached":false,"method":"POST","outputData":[],"outputSize":0,"parser":null,"path":"/api/ask","protocol":"http:","res":{"_consuming":false,"_dumped":false,"_events":{"end":[null,null]},"_eventsCount":4,"_readableState":{"autoDestroy":true,"awaitDrainWriters":null,"buffer":{"head":null,"length":0,"tail":null},"closeEmitted":true,"closed":true,"constructed":true,"dataEmitted":true,"decoder":null,"defaultEncoding":"utf8","destroyed":true,"emitClose":true,"emittedReadable":false,"encoding":null,"endEmitted":true,"ended":true,"errorEmitted":false,"errored":null,"flowing":true,"highWaterMark":16384,"length":0,"multiAwaitDrain":false,"needReadable":false,"objectMode":false,"pipes":[],"readableListening":false,"reading":false,"readingMore":true,"resumeScheduled":false,"sync":true},"aborted":false,"client":{"_events":{"close":[null,null]},"_eventsCount":7,"_hadError":false,"_host":"localhost","_httpMessage":"[Circular]","_parent":null,"_pendingData":null,"_pendingEncoding":"","_readableState":{"autoDestroy":true,"awaitDrainWriters":null,"buffer":{"head":null,"length":0,"tail":null},"closeEmitted":false,"closed":false,"constructed":true,"dataEmitted":true,"decoder":null,"defaultEncoding":"utf8","destroyed":false,"emitClose":false,"emittedReadable":false,"encoding":null,"endEmitted":false,"ended":false,"errorEmitted":false,"errored":null,"flowing":true,"highWaterMark":16384,"length":0,"multiAwaitDrain":false,"needReadable":true,"objectMode":false,"pipes":[],"readableListening":false,"reading":true,"readingMore":false,"resumeScheduled":false,"sync":false},"_server":null,"_sockname":null,"_writableState":{"afterWriteTickInfo":null,"allBuffers":true,"allNoop":true,"autoDestroy":true,"bufferProcessing":false,"buffered":[],"bufferedIndex":0,"closeEmitted":false,"closed":false,"constructed":true,"corked":0,"decodeStrings":false,"defaultEncoding":"utf8","destroyed":false,"emitClose":false,"ended":true,"ending":true,"errorEmitted":false,"errored":null,"finalCalled":true,"finished":false,"highWaterMark":16384,"length":0,"needDrain":false,"objectMode":false,"pendingcb":1,"prefinished":false,"sync":false,"writecb":null,"writelen":0,"writing":false},"allowHalfOpen":false,"connecting":false,"parser":null,"server":null},"complete":true,"httpVersion":"1.1","httpVersionMajor":1,"httpVersionMinor":1,"method":null,"rawHeaders":["X-Powered-By","Express","Content-Type","application/json; charset=utf-8","Content-Length","83","ETag","W/\"53-r1gE0xIC+8fgNRuH768xfjuFcI8\"","Date","Tue, 22 Apr 2025 15:44:24 GMT","Connection","close"],"rawTrailers":[],"redirects":[],"req":"[Circular]","responseUrl":"http://localhost:10002/api/ask","socket":{"_events":{"close":[null,null]},"_eventsCount":7,"_hadError":false,"_host":"localhost","_httpMessage":"[Circular]","_parent":null,"_pendingData":null,"_pendingEncoding":"","_readableState":{"autoDestroy":true,"awaitDrainWriters":null,"buffer":{"head":null,"length":0,"tail":null},"closeEmitted":false,"closed":false,"constructed":true,"dataEmitted":true,"decoder":null,"defaultEncoding":"utf8","destroyed":false,"emitClose":false,"emittedReadable":false,"encoding":null,"endEmitted":false,"ended":false,"errorEmitted":false,"errored":null,"flowing":true,"highWaterMark":16384,"length":0,"multiAwaitDrain":false,"needReadable":true,"objectMode":false,"pipes":[],"readableListening":false,"reading":true,"readingMore":false,"resumeScheduled":false,"sync":false},"_server":null,"_sockname":null,"_writableState":{"afterWriteTickInfo":null,"allBuffers":true,"allNoop":true,"autoDestroy":true,"bufferProcessing":false,"buffered":[],"bufferedIndex":0,"closeEmitted":false,"closed":false,"constructed":true,"corked":0,"decodeStrings":false,"defaultEncoding":"utf8","destroyed":false,"emitClose":false,"ended":true,"ending":true,"errorEmitted":false,"errored":null,"finalCalled":true,"finished":false,"highWaterMark":16384,"length":0,"needDrain":false,"objectMode":false,"pendingcb":1,"prefinished":false,"sync":false,"writecb":null,"writelen":0,"writing":false},"allowHalfOpen":false,"connecting":false,"parser":null,"server":null},"statusCode":422,"statusMessage":"Unprocessable Entity","upgrade":false,"url":""},"reusedSocket":false,"sendDate":false,"shouldKeepAlive":false,"socket":{"_events":{"close":[null,null]},"_eventsCount":7,"_hadError":false,"_host":"localhost","_httpMessage":"[Circular]","_parent":null,"_pendingData":null,"_pendingEncoding":"","_readableState":{"autoDestroy":true,"awaitDrainWriters":null,"buffer":{"head":null,"length":0,"tail":null},"closeEmitted":false,"closed":false,"constructed":true,"dataEmitted":true,"decoder":null,"defaultEncoding":"utf8","destroyed":false,"emitClose":false,"emittedReadable":false,"encoding":null,"endEmitted":false,"ended":false,"errorEmitted":false,"errored":null,"flowing":true,"highWaterMark":16384,"length":0,"multiAwaitDrain":false,"needReadable":true,"objectMode":false,"pipes":[],"readableListening":false,"reading":true,"readingMore":false,"resumeScheduled":false,"sync":false},"_server":null,"_sockname":null,"_writableState":{"afterWriteTickInfo":null,"allBuffers":true,"allNoop":true,"autoDestroy":true,"bufferProcessing":false,"buffered":[],"bufferedIndex":0,"closeEmitted":false,"closed":false,"constructed":true,"corked":0,"decodeStrings":false,"defaultEncoding":"utf8","destroyed":false,"emitClose":false,"ended":true,"ending":true,"errorEmitted":false,"errored":null,"finalCalled":true,"finished":false,"highWaterMark":16384,"length":0,"needDrain":false,"objectMode":false,"pendingcb":1,"prefinished":false,"sync":false,"writecb":null,"writelen":0,"writing":false},"allowHalfOpen":false,"connecting":false,"parser":null,"server":null},"timeoutCb":null,"upgradeOrConnect":false,"useChunkedEncodingByDefault":true,"writable":true},"status":422,"statusText":"Unprocessable Entity"},"stack":"AxiosError: Request failed with status code 422\n at settle (/Users/johnny/Documents/Tiledesk/tiledesk-chatbot/tybotRoute/node_modules/axios/dist/node/axios.cjs:2019:12)\n at IncomingMessage.handleStreamEnd (/Users/johnny/Documents/Tiledesk/tiledesk-chatbot/tybotRoute/node_modules/axios/dist/node/axios.cjs:3135:11)\n at IncomingMessage.emit (node:events:525:35)\n at endReadableNT (node:internal/streams/readable:1358:12)\n at processTicksAndRejections (node:internal/process/task_queues:83:21)\n at Axios.request (/Users/johnny/Documents/Tiledesk/tiledesk-chatbot/tybotRoute/node_modules/axios/dist/node/axios.cjs:4287:41)\n at runMicrotasks (<anonymous>)\n at processTicksAndRejections (node:internal/process/task_queues:96:5)","status":422}
3799
+ info: Starting tilebot server...
3800
+ info: (Tilebot) Starting Tilebot..
3801
+ info: (Tilebot) settings.API_ENDPOINT:http://localhost:10002
3802
+ info: (Tilebot) settings.TILEBOT_ENDPOINT:http://localhost:10001
3803
+ info: (Tilebot) Log Level: info
3804
+ info: (Tilebot) MAX_STEPS: 1000
3805
+ info: (Tilebot) MAX_EXECUTION_TIME: 28800000
3806
+ info: (Tilebot) Starting Tilebot connector v2.0.10-rc7
3807
+ info: (Tilebot) Using static bots
3808
+ info: (Tilebot) Connecting Redis...
3809
+ info: (Tilebot) Redis connected
3810
+ info: (Tilebot) Tilebot started
3811
+ info: Tilebot route successfully started.
3812
+ info: Tilebot connector listening on port 10001
3813
+ error: (DirAskGPT) Error: gptkey is mandatory
3814
+ error: Axios error response data: {"error":"no knowledge base settings found"}
3815
+ error: DirAskGPT Get kb settings error {"error":"no knowledge base settings found"}
3816
+ error: (DirAskGPT) Error: gptkey is mandatory
3817
+ error: (DirAskGPT) Error: question attribute is mandatory. Executing condition false...
3818
+ error: (DirAskGPT) Error: kbid attribute is mandatory. Executing condition false...
3819
+ info: Starting tilebot server...
3820
+ info: (Tilebot) Starting Tilebot..
3821
+ info: (Tilebot) settings.API_ENDPOINT:http://localhost:10002
3822
+ info: (Tilebot) settings.TILEBOT_ENDPOINT:http://localhost:10001
3823
+ info: (Tilebot) Log Level: info
3824
+ info: (Tilebot) MAX_STEPS: 1000
3825
+ info: (Tilebot) MAX_EXECUTION_TIME: 28800000
3826
+ info: (Tilebot) Starting Tilebot connector v2.0.10-rc7
3827
+ info: (Tilebot) Using static bots
3828
+ info: (Tilebot) Connecting Redis...
3829
+ info: (Tilebot) Redis connected
3830
+ info: (Tilebot) Tilebot started
3831
+ info: Tilebot route successfully started.
3832
+ info: Tilebot connector listening on port 10001
3833
+ error: Axios error response data: {"error":{"answer":"No answer","chat_history_dict":{},"citations":null,"content_chunks":null,"error_message":"IndexError('list index out of range')","id":null,"ids":null,"namespace":"66ec24a028a0c600130baa6a","prompt_token_size":0,"source":null,"sources":null,"success":false},"statusText":"Bad Request","success":false}
3834
+ error: DirAskGPTV2 error:
3835
+ info: DirAskGPTV2 Error: gptkey is mandatory
3836
+ error: Axios error response data: {"error":"no knowledge base settings found"}
3837
+ error: DirAskGPTV2 Get kb settings error {"error":"no knowledge base settings found"}
3838
+ info: DirAskGPTV2 Error: gptkey is mandatory
3839
+ error: DirAskGPTV2 Error: question attribute is mandatory. Executing condition false...
3840
+ info: Starting tilebot server...
3841
+ info: (Tilebot) Starting Tilebot..
3842
+ info: (Tilebot) settings.API_ENDPOINT:http://localhost:10002
3843
+ info: (Tilebot) settings.TILEBOT_ENDPOINT:http://localhost:10001
3844
+ info: (Tilebot) Log Level: info
3845
+ info: (Tilebot) MAX_STEPS: 1000
3846
+ info: (Tilebot) MAX_EXECUTION_TIME: 28800000
3847
+ info: (Tilebot) Starting Tilebot connector v2.0.10-rc7
3848
+ info: (Tilebot) Using static bots
3849
+ info: (Tilebot) Connecting Redis...
3850
+ info: (Tilebot) Redis connected
3851
+ info: (Tilebot) Tilebot started
3852
+ info: Tilebot route successfully started.
3853
+ info: Tilebot connector listening on port
3854
+ error: (DirBrevo) DirBrevo err data result:
3855
+ error: (DirBrevo) DirBrevo err data status:
3856
+ error: (DirBrevo) DirBrevo err data error:
3857
+ error: (DirBrevo) DirBrevo err data result:
3858
+ error: (DirBrevo) DirBrevo err data status:
3859
+ error: (DirBrevo) DirBrevo err data error:
3860
+ error: (DirBrevo) DirBrevo err data result:
3861
+ error: (DirBrevo) DirBrevo err data status:
3862
+ error: (DirBrevo) DirBrevo err data error:
3863
+ info: Starting tilebot server...
3864
+ info: (Tilebot) Starting Tilebot..
3865
+ info: (Tilebot) settings.API_ENDPOINT:http://localhost:10002
3866
+ info: (Tilebot) settings.TILEBOT_ENDPOINT:http://localhost:10001
3867
+ info: (Tilebot) Log Level: info
3868
+ info: (Tilebot) MAX_STEPS: 1000
3869
+ info: (Tilebot) MAX_EXECUTION_TIME: 28800000
3870
+ info: (Tilebot) Starting Tilebot connector v2.0.10-rc7
3871
+ info: (Tilebot) Using static bots
3872
+ info: (Tilebot) Connecting Redis...
3873
+ info: (Tilebot) Redis connected
3874
+ info: (Tilebot) Tilebot started
3875
+ info: Tilebot route successfully started.
3876
+ info: Tilebot connector listening on port
3877
+ info: Wait a little (~1s)...
3878
+ info: Starting tilebot server...
3879
+ info: (Tilebot) Starting Tilebot..
3880
+ info: (Tilebot) settings.API_ENDPOINT:http://localhost:10002
3881
+ info: (Tilebot) settings.TILEBOT_ENDPOINT:http://localhost:10001
3882
+ info: (Tilebot) Log Level: info
3883
+ info: (Tilebot) MAX_STEPS: 1000
3884
+ info: (Tilebot) MAX_EXECUTION_TIME: 28800000
3885
+ info: (Tilebot) Starting Tilebot connector v2.0.10-rc7
3886
+ info: (Tilebot) Using static bots
3887
+ info: (Tilebot) Connecting Redis...
3888
+ info: (Tilebot) Redis connected
3889
+ info: (Tilebot) Tilebot started
3890
+ info: Tilebot route successfully started.
3891
+ info: Tilebot connector listening on port
3892
+ error: (TiledeskExpression) evaluateJavascriptExpression error: jsondata2 is not defined - while evaluating the following expression: '
3893
+ console.log('a var...chatbot_name!', context.attributes.chatbot_name);
3894
+ context.setAttribute('myvar', '1');
3895
+ context.deleteAttribute('chatbot_name');
3896
+ context.deleteAttribute('conversation_id');
3897
+ context.attributes.jsondata2.c = 7;
3898
+ context.setAttribute('jsondata2', jsondata2);
3899
+ console.log("all vars:", context.allVars());
3900
+ '
3901
+ info: Starting tilebot server...
3902
+ info: (Tilebot) Starting Tilebot..
3903
+ info: (Tilebot) settings.API_ENDPOINT:http://localhost:10002
3904
+ info: (Tilebot) settings.TILEBOT_ENDPOINT:http://localhost:10001
3905
+ info: (Tilebot) Log Level: info
3906
+ info: (Tilebot) MAX_STEPS: 1000
3907
+ info: (Tilebot) MAX_EXECUTION_TIME: 28800000
3908
+ info: (Tilebot) Starting Tilebot connector v2.0.10-rc7
3909
+ info: (Tilebot) Using static bots
3910
+ info: (Tilebot) Connecting Redis...
3911
+ info: (Tilebot) Redis connected
3912
+ info: (Tilebot) Tilebot started
3913
+ info: Tilebot route successfully started.
3914
+ info: Tilebot connector listening on port
3915
+ info: Starting tilebot server...
3916
+ info: (Tilebot) Starting Tilebot..
3917
+ info: (Tilebot) settings.API_ENDPOINT:http://localhost:10002
3918
+ info: (Tilebot) settings.TILEBOT_ENDPOINT:http://localhost:10001
3919
+ info: (Tilebot) Log Level: info
3920
+ info: (Tilebot) MAX_STEPS: 1000
3921
+ info: (Tilebot) MAX_EXECUTION_TIME: 28800000
3922
+ info: (Tilebot) Starting Tilebot connector v2.0.10-rc7
3923
+ info: (Tilebot) Using static bots
3924
+ info: (Tilebot) Connecting Redis...
3925
+ info: (Tilebot) Redis connected
3926
+ info: (Tilebot) Tilebot started
3927
+ info: Tilebot route successfully started.
3928
+ info: Tilebot connector listening on port
3929
+ info: Starting tilebot server...
3930
+ info: (Tilebot) Starting Tilebot..
3931
+ info: (Tilebot) settings.API_ENDPOINT:http://localhost:10002
3932
+ info: (Tilebot) settings.TILEBOT_ENDPOINT:http://localhost:10001
3933
+ info: (Tilebot) Log Level: info
3934
+ info: (Tilebot) MAX_STEPS: 1000
3935
+ info: (Tilebot) MAX_EXECUTION_TIME: 28800000
3936
+ info: (Tilebot) Starting Tilebot connector v2.0.10-rc7
3937
+ info: (Tilebot) Using static bots
3938
+ info: (Tilebot) Connecting Redis...
3939
+ info: (Tilebot) Redis connected
3940
+ info: (Tilebot) Tilebot started
3941
+ info: Tilebot route successfully started.
3942
+ info: Tilebot connector listening on port
3943
+ error: Axios error response data: {"error":"Required parameters botid not found. Value is 'null' or 'undefined'","success":false}
3944
+ error: Axios error response data: {"error":"Required parameters botid not found. Value is 'null' or 'undefined'","success":false}
3945
+ info: Starting tilebot server...
3946
+ info: (Tilebot) Starting Tilebot..
3947
+ info: (Tilebot) settings.API_ENDPOINT:http://localhost:10002
3948
+ info: (Tilebot) settings.TILEBOT_ENDPOINT:http://localhost:10001
3949
+ info: (Tilebot) Log Level: info
3950
+ info: (Tilebot) MAX_STEPS: 1000
3951
+ info: (Tilebot) MAX_EXECUTION_TIME: 28800000
3952
+ info: (Tilebot) Starting Tilebot connector v2.0.10-rc7
3953
+ info: (Tilebot) Using static bots
3954
+ info: (Tilebot) Connecting Redis...
3955
+ info: (Tilebot) Redis connected
3956
+ info: (Tilebot) Tilebot started
3957
+ info: Tilebot route successfully started.
3958
+ info: Tilebot connector listening on port
3959
+ error: (TiledeskChatbot) An error occurred during exact match: Cannot read properties of undefined (reading '/start') {"stack":"TypeError: Cannot read properties of undefined (reading '/start')\n at MockBotsDataSource.getByExactMatch (/Users/johnny/Documents/Tiledesk/tiledesk-chatbot/tybotRoute/engine/mock/MockBotsDataSource.js:40:71)\n at /Users/johnny/Documents/Tiledesk/tiledesk-chatbot/tybotRoute/engine/TiledeskChatbot.js:181:42\n at runMicrotasks (<anonymous>)\n at processTicksAndRejections (node:internal/process/task_queues:96:5)"}
3960
+ error: (TiledeskChatbot) An error occurred on IntentsFinder.decode() (/model/parse error):this.intentsFinder.decode is not a function
3961
+ info: Starting tilebot server...
3962
+ info: (Tilebot) Starting Tilebot..
3963
+ info: (Tilebot) settings.API_ENDPOINT:http://localhost:10002
3964
+ info: (Tilebot) settings.TILEBOT_ENDPOINT:http://localhost:10001
3965
+ info: (Tilebot) Log Level: info
3966
+ info: (Tilebot) MAX_STEPS: 1000
3967
+ info: (Tilebot) MAX_EXECUTION_TIME: 28800000
3968
+ info: (Tilebot) Starting Tilebot connector v2.0.10-rc7
3969
+ info: (Tilebot) Using static bots
3970
+ info: (Tilebot) Connecting Redis...
3971
+ info: (Tilebot) Redis connected
3972
+ info: (Tilebot) Tilebot started
3973
+ info: Tilebot route successfully started.
3974
+ info: Tilebot connector listening on port
3975
+ info: Adding log 'This is a log' with level info
3976
+ info: Adding log 'This is a log: Hello from payload' with level info
3977
+ info: Adding log 'This is a log: {"name":"John","age":30}' with level info
3978
+ info: Starting tilebot server...
3979
+ info: (Tilebot) Starting Tilebot..
3980
+ info: (Tilebot) settings.API_ENDPOINT:http://localhost:10002
3981
+ info: (Tilebot) settings.TILEBOT_ENDPOINT:http://localhost:10001
3982
+ info: (Tilebot) Log Level: info
3983
+ info: (Tilebot) MAX_STEPS: 1000
3984
+ info: (Tilebot) MAX_EXECUTION_TIME: 28800000
3985
+ info: (Tilebot) Starting Tilebot connector v2.0.10-rc7
3986
+ info: (Tilebot) Using static bots
3987
+ info: (Tilebot) Connecting Redis...
3988
+ info: (Tilebot) Redis connected
3989
+ info: (Tilebot) Tilebot started
3990
+ info: Tilebot route successfully started.
3991
+ info: Tilebot connector listening on port 10001
3992
+ info: Starting tilebot server...
3993
+ info: (Tilebot) Starting Tilebot..
3994
+ info: (Tilebot) settings.API_ENDPOINT:http://localhost:10002
3995
+ info: (Tilebot) settings.TILEBOT_ENDPOINT:http://localhost:10001
3996
+ info: (Tilebot) Log Level: info
3997
+ info: (Tilebot) MAX_STEPS: 1000
3998
+ info: (Tilebot) MAX_EXECUTION_TIME: 28800000
3999
+ info: (Tilebot) Starting Tilebot connector v2.0.10-rc7
4000
+ info: (Tilebot) Using static bots
4001
+ info: (Tilebot) Connecting Redis...
4002
+ info: (Tilebot) Redis connected
4003
+ info: (Tilebot) Tilebot started
4004
+ info: Tilebot route successfully started.
4005
+ info: Tilebot connector listening on port 10001
4006
+ error: Axios error response data: {"error":{"code":null,"message":"you must provide a model parameter","param":null,"type":"invalid_request_error"}}
4007
+ error: (DirGptTask) gptkey is mandatory
4008
+ error: Axios error response data: Communication interrupted
4009
+ error: Axios error response data: <!DOCTYPE html>
4010
+ <html lang="en">
4011
+ <head>
4012
+ <meta charset="utf-8">
4013
+ <title>Error</title>
4014
+ </head>
4015
+ <body>
4016
+ <pre>Cannot GET /projectID/kbsettings</pre>
4017
+ </body>
4018
+ </html>
4019
+
4020
+ error: (DirGptTask) Get KnowledgeBase err:
4021
+ error: (DirGptTask) gptkey is mandatory
4022
+ info: Starting tilebot server...
4023
+ info: (Tilebot) Starting Tilebot..
4024
+ info: (Tilebot) settings.API_ENDPOINT:http://localhost:10002
4025
+ info: (Tilebot) settings.TILEBOT_ENDPOINT:http://localhost:10001
4026
+ info: (Tilebot) Log Level: info
4027
+ info: (Tilebot) MAX_STEPS: 1000
4028
+ info: (Tilebot) MAX_EXECUTION_TIME: 28800000
4029
+ info: (Tilebot) Starting Tilebot connector v2.0.10-rc7
4030
+ info: (Tilebot) Using static bots
4031
+ info: (Tilebot) Connecting Redis...
4032
+ info: (Tilebot) Redis connected
4033
+ info: (Tilebot) Tilebot started
4034
+ info: Tilebot route successfully started.
4035
+ info: Tilebot connector listening on port 10001
4036
+ error: (DirHubspot) err response: Contact already exists. Existing ID: 801 {"category":"CONFLICT","correlationId":"f426b0c0-1063-4aac-9859-f40108dcb09b","status":"error"}
4037
+ error: (DirHubspot) err response: Authentication credentials not found. This API supports OAuth 2.0 authentication and you can find more details at https://developers.hubspot.com/docs/methods/auth/oauth-overview {"category":"INVALID_AUTHENTICATION","correlationId":"53dab600-5de9-4aa3-b631-b0f11f43e062","status":"error"}
4038
+ error: (DirHubspot) err response: Property values were not valid: [{"isValid":false,"message":"Email address dsfsafas@ is invalid","error":"INVALID_EMAIL","name":"email"}] {"category":"VALIDATION_ERROR","correlationId":"e3d7ddf8-5d21-4059-86d0-35ae9093755c","status":"error"}
4039
+ info: Starting tilebot server...
4040
+ info: (Tilebot) Starting Tilebot..
4041
+ info: (Tilebot) settings.API_ENDPOINT:http://localhost:10002
4042
+ info: (Tilebot) settings.TILEBOT_ENDPOINT:http://localhost:10001
4043
+ info: (Tilebot) Log Level: info
4044
+ info: (Tilebot) MAX_STEPS: 1000
4045
+ info: (Tilebot) MAX_EXECUTION_TIME: 28800000
4046
+ info: (Tilebot) Starting Tilebot connector v2.0.10-rc7
4047
+ info: (Tilebot) Using static bots
4048
+ info: (Tilebot) Connecting Redis...
4049
+ info: (Tilebot) Redis connected
4050
+ info: (Tilebot) Tilebot started
4051
+ info: Tilebot route successfully started.
4052
+ info: Tilebot connector listening on port 10001
4053
+ info: Starting tilebot server...
4054
+ info: (Tilebot) Starting Tilebot..
4055
+ info: (Tilebot) settings.API_ENDPOINT:http://localhost:10002
4056
+ info: (Tilebot) settings.TILEBOT_ENDPOINT:http://localhost:10001
4057
+ info: (Tilebot) Log Level: info
4058
+ info: (Tilebot) MAX_STEPS: 1000
4059
+ info: (Tilebot) MAX_EXECUTION_TIME: 28800000
4060
+ info: (Tilebot) Starting Tilebot connector v2.0.10-rc7
4061
+ info: (Tilebot) Using static bots
4062
+ info: (Tilebot) Connecting Redis...
4063
+ info: (Tilebot) Redis connected
4064
+ info: (Tilebot) Tilebot started
4065
+ info: Tilebot route successfully started.
4066
+ info: Tilebot connector listening on port 10001
4067
+ info: Starting tilebot server...
4068
+ info: (Tilebot) Starting Tilebot..
4069
+ info: (Tilebot) settings.API_ENDPOINT:http://localhost:10002
4070
+ info: (Tilebot) settings.TILEBOT_ENDPOINT:http://localhost:10001
4071
+ info: (Tilebot) Log Level: info
4072
+ info: (Tilebot) MAX_STEPS: 1000
4073
+ info: (Tilebot) MAX_EXECUTION_TIME: 28800000
4074
+ info: (Tilebot) Starting Tilebot connector v2.0.10-rc7
4075
+ info: (Tilebot) Using static bots
4076
+ info: (Tilebot) Connecting Redis...
4077
+ info: (Tilebot) Redis connected
4078
+ info: (Tilebot) Tilebot started
4079
+ info: Tilebot route successfully started.
4080
+ info: Tilebot connector listening on port 10001
4081
+ error: (DirMake) Error: webhook_url is undefined or null or empty string:
4082
+ info: Starting tilebot server...
4083
+ info: (Tilebot) Starting Tilebot..
4084
+ info: (Tilebot) settings.API_ENDPOINT:http://localhost:10002
4085
+ info: (Tilebot) settings.TILEBOT_ENDPOINT:http://localhost:10001
4086
+ info: (Tilebot) Log Level: info
4087
+ info: (Tilebot) MAX_STEPS: 1000
4088
+ info: (Tilebot) MAX_EXECUTION_TIME: 28800000
4089
+ info: (Tilebot) Starting Tilebot connector v2.0.10-rc7
4090
+ info: (Tilebot) Using static bots
4091
+ info: (Tilebot) Connecting Redis...
4092
+ info: (Tilebot) Redis connected
4093
+ info: (Tilebot) Tilebot started
4094
+ info: Tilebot route successfully started.
4095
+ info: Tilebot connector listening on port 10001
4096
+ info: Starting tilebot server...
4097
+ info: (Tilebot) Starting Tilebot..
4098
+ info: (Tilebot) settings.API_ENDPOINT:http://localhost:10002
4099
+ info: (Tilebot) settings.TILEBOT_ENDPOINT:http://localhost:10001
4100
+ info: (Tilebot) Log Level: info
4101
+ info: (Tilebot) MAX_STEPS: 1000
4102
+ info: (Tilebot) MAX_EXECUTION_TIME: 28800000
4103
+ info: (Tilebot) Starting Tilebot connector v2.0.10-rc7
4104
+ info: (Tilebot) Using static bots
4105
+ info: (Tilebot) Connecting Redis...
4106
+ info: (Tilebot) Redis connected
4107
+ info: (Tilebot) Tilebot started
4108
+ info: Tilebot route successfully started.
4109
+ info: Tilebot connector listening on port 10001
4110
+ info: Starting tilebot server...
4111
+ info: (Tilebot) Starting Tilebot..
4112
+ info: (Tilebot) settings.API_ENDPOINT:http://localhost:10002
4113
+ info: (Tilebot) settings.TILEBOT_ENDPOINT:http://localhost:10001
4114
+ info: (Tilebot) Log Level: info
4115
+ info: (Tilebot) MAX_STEPS: 1000
4116
+ info: (Tilebot) MAX_EXECUTION_TIME: 28800000
4117
+ info: (Tilebot) Starting Tilebot connector v2.0.10-rc7
4118
+ info: (Tilebot) Using static bots
4119
+ info: (Tilebot) Connecting Redis...
4120
+ info: (Tilebot) Redis connected
4121
+ info: (Tilebot) Tilebot started
4122
+ info: Tilebot route successfully started.
4123
+ info: Tilebot connector listening on port 10001
4124
+ info: Starting tilebot server...
4125
+ info: (Tilebot) Starting Tilebot..
4126
+ info: (Tilebot) settings.API_ENDPOINT:http://localhost:10002
4127
+ info: (Tilebot) settings.TILEBOT_ENDPOINT:http://localhost:10001
4128
+ info: (Tilebot) Log Level: info
4129
+ info: (Tilebot) MAX_STEPS: 1000
4130
+ info: (Tilebot) MAX_EXECUTION_TIME: 28800000
4131
+ info: (Tilebot) Starting Tilebot connector v2.0.10-rc7
4132
+ info: (Tilebot) Using static bots
4133
+ info: (Tilebot) Connecting Redis...
4134
+ info: (Tilebot) Redis connected
4135
+ info: (Tilebot) Tilebot started
4136
+ info: Tilebot route successfully started.
4137
+ info: Tilebot connector listening on port 10001
4138
+ info: Starting tilebot server...
4139
+ info: (Tilebot) Starting Tilebot..
4140
+ info: (Tilebot) settings.API_ENDPOINT:http://localhost:10002
4141
+ info: (Tilebot) settings.TILEBOT_ENDPOINT:http://localhost:10001
4142
+ info: (Tilebot) Log Level: info
4143
+ info: (Tilebot) MAX_STEPS: 1000
4144
+ info: (Tilebot) MAX_EXECUTION_TIME: 28800000
4145
+ info: (Tilebot) Starting Tilebot connector v2.0.10-rc7
4146
+ info: (Tilebot) Using static bots
4147
+ info: (Tilebot) Connecting Redis...
4148
+ info: (Tilebot) Redis connected
4149
+ info: (Tilebot) Tilebot started
4150
+ info: Tilebot route successfully started.
4151
+ info: Tilebot connector listening on port 10001
4152
+ error: Axios error response data:
4153
+ error: Axios error response data:
4154
+ error: Axios error response: {"config":{"adapter":["xhr","http","fetch"],"env":{"Blob":null},"headers":{"Accept":"application/json, text/plain, */*","Accept-Encoding":"gzip, compress, deflate, br","Authorization":"JWT XXX","Content-Type":"application/json","User-Agent":"axios/1.7.7"},"maxBodyLength":-1,"maxContentLength":-1,"method":"get","timeout":0,"transformRequest":[null],"transformResponse":[null],"transitional":{"clarifyTimeoutError":false,"forcedJSONParsing":true,"silentJSONParsing":true},"url":"http://localhost:10002/projectID/integration/name/qapla","xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN"},"data":"","headers":{"connection":"close","content-length":"0","date":"Tue, 22 Apr 2025 15:44:26 GMT","x-powered-by":"Express"},"request":{"_closed":false,"_contentLength":0,"_defaultKeepAlive":true,"_ended":true,"_events":{},"_eventsCount":7,"_hasBody":true,"_header":"GET /projectID/integration/name/qapla HTTP/1.1\r\nAccept: application/json, text/plain, */*\r\nContent-Type: application/json\r\nAuthorization: JWT XXX\r\nUser-Agent: axios/1.7.7\r\nAccept-Encoding: gzip, compress, deflate, br\r\nHost: localhost:10002\r\nConnection: close\r\n\r\n","_headerSent":true,"_keepAliveTimeout":0,"_last":true,"_redirectable":{"_currentRequest":"[Circular]","_currentUrl":"http://localhost:10002/projectID/integration/name/qapla","_ended":true,"_ending":true,"_events":{},"_eventsCount":3,"_options":{"agents":{},"beforeRedirects":{},"headers":{"Accept":"application/json, text/plain, */*","Accept-Encoding":"gzip, compress, deflate, br","Authorization":"JWT XXX","Content-Type":"application/json","User-Agent":"axios/1.7.7"},"hostname":"localhost","maxBodyLength":null,"maxRedirects":21,"method":"GET","nativeProtocols":{"http:":{"METHODS":["ACL","BIND","CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LINK","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCALENDAR","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REBIND","REPORT","SEARCH","SOURCE","SUBSCRIBE","TRACE","UNBIND","UNLINK","UNLOCK","UNSUBSCRIBE"],"STATUS_CODES":{"100":"Continue","101":"Switching Protocols","102":"Processing","103":"Early Hints","200":"OK","201":"Created","202":"Accepted","203":"Non-Authoritative Information","204":"No Content","205":"Reset Content","206":"Partial Content","207":"Multi-Status","208":"Already Reported","226":"IM Used","300":"Multiple Choices","301":"Moved Permanently","302":"Found","303":"See Other","304":"Not Modified","305":"Use Proxy","307":"Temporary Redirect","308":"Permanent Redirect","400":"Bad Request","401":"Unauthorized","402":"Payment Required","403":"Forbidden","404":"Not Found","405":"Method Not Allowed","406":"Not Acceptable","407":"Proxy Authentication Required","408":"Request Timeout","409":"Conflict","410":"Gone","411":"Length Required","412":"Precondition Failed","413":"Payload Too Large","414":"URI Too Long","415":"Unsupported Media Type","416":"Range Not Satisfiable","417":"Expectation Failed","418":"I'm a Teapot","421":"Misdirected Request","422":"Unprocessable Entity","423":"Locked","424":"Failed Dependency","425":"Too Early","426":"Upgrade Required","428":"Precondition Required","429":"Too Many Requests","431":"Request Header Fields Too Large","451":"Unavailable For Legal Reasons","500":"Internal Server Error","501":"Not Implemented","502":"Bad Gateway","503":"Service Unavailable","504":"Gateway Timeout","505":"HTTP Version Not Supported","506":"Variant Also Negotiates","507":"Insufficient Storage","508":"Loop Detected","509":"Bandwidth Limit Exceeded","510":"Not Extended","511":"Network Authentication Required"},"globalAgent":{"_events":{},"_eventsCount":2,"defaultPort":80,"freeSockets":{},"keepAlive":false,"keepAliveMsecs":1000,"maxFreeSockets":256,"maxSockets":null,"maxTotalSockets":null,"options":{"path":null},"protocol":"http:","requests":{},"scheduling":"lifo","sockets":{"localhost:10002:":[{"_events":{"close":[null,null]},"_eventsCount":7,"_hadError":false,"_host":"localhost","_httpMessage":"[Circular]","_parent":null,"_pendingData":null,"_pendingEncoding":"","_readableState":{"autoDestroy":true,"awaitDrainWriters":null,"buffer":{"head":null,"length":0,"tail":null},"closeEmitted":false,"closed":false,"constructed":true,"dataEmitted":true,"decoder":null,"defaultEncoding":"utf8","destroyed":false,"emitClose":false,"emittedReadable":false,"encoding":null,"endEmitted":false,"ended":false,"errorEmitted":false,"errored":null,"flowing":true,"highWaterMark":16384,"length":0,"multiAwaitDrain":false,"needReadable":true,"objectMode":false,"pipes":[],"readableListening":false,"reading":true,"readingMore":false,"resumeScheduled":false,"sync":false},"_server":null,"_sockname":null,"_writableState":{"afterWriteTickInfo":null,"allBuffers":true,"allNoop":true,"autoDestroy":true,"bufferProcessing":false,"buffered":[],"bufferedIndex":0,"closeEmitted":false,"closed":false,"constructed":true,"corked":0,"decodeStrings":false,"defaultEncoding":"utf8","destroyed":false,"emitClose":false,"ended":true,"ending":true,"errorEmitted":false,"errored":null,"finalCalled":true,"finished":false,"highWaterMark":16384,"length":0,"needDrain":false,"objectMode":false,"pendingcb":1,"prefinished":false,"sync":false,"writecb":null,"writelen":0,"writing":false},"allowHalfOpen":false,"connecting":false,"parser":null,"server":null}]},"totalSocketCount":1},"maxHeaderSize":16384},"https:":{"globalAgent":{"_events":{},"_eventsCount":2,"_sessionCache":{"list":[],"map":{}},"defaultPort":443,"freeSockets":{},"keepAlive":false,"keepAliveMsecs":1000,"maxCachedSessions":100,"maxFreeSockets":256,"maxSockets":null,"maxTotalSockets":null,"options":{"path":null},"protocol":"https:","requests":{},"scheduling":"lifo","sockets":{},"totalSocketCount":0}}},"path":"/projectID/integration/name/qapla","pathname":"/projectID/integration/name/qapla","port":"10002","protocol":"http:"},"_redirectCount":0,"_redirects":[],"_requestBodyBuffers":[],"_requestBodyLength":0,"_writableState":{"afterWriteTickInfo":null,"allBuffers":true,"allNoop":true,"autoDestroy":true,"bufferProcessing":false,"buffered":[],"bufferedIndex":0,"closeEmitted":false,"closed":false,"constructed":true,"corked":0,"decodeStrings":true,"defaultEncoding":"utf8","destroyed":false,"emitClose":true,"ended":false,"ending":false,"errorEmitted":false,"errored":null,"finalCalled":false,"finished":false,"highWaterMark":16384,"length":0,"needDrain":false,"objectMode":false,"pendingcb":0,"prefinished":false,"sync":true,"writecb":null,"writelen":0,"writing":false}},"_removedConnection":false,"_removedContLen":false,"_removedTE":false,"_trailer":"","aborted":false,"agent":{"_events":{},"_eventsCount":2,"defaultPort":80,"freeSockets":{},"keepAlive":false,"keepAliveMsecs":1000,"maxFreeSockets":256,"maxSockets":null,"maxTotalSockets":null,"options":{"path":null},"protocol":"http:","requests":{},"scheduling":"lifo","sockets":{"localhost:10002:":[{"_events":{"close":[null,null]},"_eventsCount":7,"_hadError":false,"_host":"localhost","_httpMessage":"[Circular]","_parent":null,"_pendingData":null,"_pendingEncoding":"","_readableState":{"autoDestroy":true,"awaitDrainWriters":null,"buffer":{"head":null,"length":0,"tail":null},"closeEmitted":false,"closed":false,"constructed":true,"dataEmitted":true,"decoder":null,"defaultEncoding":"utf8","destroyed":false,"emitClose":false,"emittedReadable":false,"encoding":null,"endEmitted":false,"ended":false,"errorEmitted":false,"errored":null,"flowing":true,"highWaterMark":16384,"length":0,"multiAwaitDrain":false,"needReadable":true,"objectMode":false,"pipes":[],"readableListening":false,"reading":true,"readingMore":false,"resumeScheduled":false,"sync":false},"_server":null,"_sockname":null,"_writableState":{"afterWriteTickInfo":null,"allBuffers":true,"allNoop":true,"autoDestroy":true,"bufferProcessing":false,"buffered":[],"bufferedIndex":0,"closeEmitted":false,"closed":false,"constructed":true,"corked":0,"decodeStrings":false,"defaultEncoding":"utf8","destroyed":false,"emitClose":false,"ended":true,"ending":true,"errorEmitted":false,"errored":null,"finalCalled":true,"finished":false,"highWaterMark":16384,"length":0,"needDrain":false,"objectMode":false,"pendingcb":1,"prefinished":false,"sync":false,"writecb":null,"writelen":0,"writing":false},"allowHalfOpen":false,"connecting":false,"parser":null,"server":null}]},"totalSocketCount":1},"chunkedEncoding":false,"destroyed":false,"finished":true,"host":"localhost","maxHeadersCount":null,"maxRequestsOnConnectionReached":false,"method":"GET","outputData":[],"outputSize":0,"parser":null,"path":"/projectID/integration/name/qapla","protocol":"http:","res":{"_consuming":false,"_dumped":false,"_events":{"end":[null,null]},"_eventsCount":4,"_readableState":{"autoDestroy":true,"awaitDrainWriters":null,"buffer":{"head":null,"length":0,"tail":null},"closeEmitted":true,"closed":true,"constructed":true,"dataEmitted":false,"decoder":null,"defaultEncoding":"utf8","destroyed":true,"emitClose":true,"emittedReadable":false,"encoding":null,"endEmitted":true,"ended":true,"errorEmitted":false,"errored":null,"flowing":true,"highWaterMark":16384,"length":0,"multiAwaitDrain":false,"needReadable":false,"objectMode":false,"pipes":[],"readableListening":false,"reading":false,"readingMore":true,"resumeScheduled":false,"sync":true},"aborted":false,"client":{"_events":{"close":[null,null]},"_eventsCount":7,"_hadError":false,"_host":"localhost","_httpMessage":"[Circular]","_parent":null,"_pendingData":null,"_pendingEncoding":"","_readableState":{"autoDestroy":true,"awaitDrainWriters":null,"buffer":{"head":null,"length":0,"tail":null},"closeEmitted":false,"closed":false,"constructed":true,"dataEmitted":true,"decoder":null,"defaultEncoding":"utf8","destroyed":false,"emitClose":false,"emittedReadable":false,"encoding":null,"endEmitted":false,"ended":false,"errorEmitted":false,"errored":null,"flowing":true,"highWaterMark":16384,"length":0,"multiAwaitDrain":false,"needReadable":true,"objectMode":false,"pipes":[],"readableListening":false,"reading":true,"readingMore":false,"resumeScheduled":false,"sync":false},"_server":null,"_sockname":null,"_writableState":{"afterWriteTickInfo":null,"allBuffers":true,"allNoop":true,"autoDestroy":true,"bufferProcessing":false,"buffered":[],"bufferedIndex":0,"closeEmitted":false,"closed":false,"constructed":true,"corked":0,"decodeStrings":false,"defaultEncoding":"utf8","destroyed":false,"emitClose":false,"ended":true,"ending":true,"errorEmitted":false,"errored":null,"finalCalled":true,"finished":false,"highWaterMark":16384,"length":0,"needDrain":false,"objectMode":false,"pendingcb":1,"prefinished":false,"sync":false,"writecb":null,"writelen":0,"writing":false},"allowHalfOpen":false,"connecting":false,"parser":null,"server":null},"complete":true,"httpVersion":"1.1","httpVersionMajor":1,"httpVersionMinor":1,"method":null,"rawHeaders":["X-Powered-By","Express","Date","Tue, 22 Apr 2025 15:44:26 GMT","Connection","close","Content-Length","0"],"rawTrailers":[],"redirects":[],"req":"[Circular]","responseUrl":"http://localhost:10002/projectID/integration/name/qapla","socket":{"_events":{"close":[null,null]},"_eventsCount":7,"_hadError":false,"_host":"localhost","_httpMessage":"[Circular]","_parent":null,"_pendingData":null,"_pendingEncoding":"","_readableState":{"autoDestroy":true,"awaitDrainWriters":null,"buffer":{"head":null,"length":0,"tail":null},"closeEmitted":false,"closed":false,"constructed":true,"dataEmitted":true,"decoder":null,"defaultEncoding":"utf8","destroyed":false,"emitClose":false,"emittedReadable":false,"encoding":null,"endEmitted":false,"ended":false,"errorEmitted":false,"errored":null,"flowing":true,"highWaterMark":16384,"length":0,"multiAwaitDrain":false,"needReadable":true,"objectMode":false,"pipes":[],"readableListening":false,"reading":true,"readingMore":false,"resumeScheduled":false,"sync":false},"_server":null,"_sockname":null,"_writableState":{"afterWriteTickInfo":null,"allBuffers":true,"allNoop":true,"autoDestroy":true,"bufferProcessing":false,"buffered":[],"bufferedIndex":0,"closeEmitted":false,"closed":false,"constructed":true,"corked":0,"decodeStrings":false,"defaultEncoding":"utf8","destroyed":false,"emitClose":false,"ended":true,"ending":true,"errorEmitted":false,"errored":null,"finalCalled":true,"finished":false,"highWaterMark":16384,"length":0,"needDrain":false,"objectMode":false,"pendingcb":1,"prefinished":false,"sync":false,"writecb":null,"writelen":0,"writing":false},"allowHalfOpen":false,"connecting":false,"parser":null,"server":null},"statusCode":404,"statusMessage":"Not Found","upgrade":false,"url":""},"reusedSocket":false,"sendDate":false,"shouldKeepAlive":false,"socket":{"_events":{"close":[null,null]},"_eventsCount":7,"_hadError":false,"_host":"localhost","_httpMessage":"[Circular]","_parent":null,"_pendingData":null,"_pendingEncoding":"","_readableState":{"autoDestroy":true,"awaitDrainWriters":null,"buffer":{"head":null,"length":0,"tail":null},"closeEmitted":false,"closed":false,"constructed":true,"dataEmitted":true,"decoder":null,"defaultEncoding":"utf8","destroyed":false,"emitClose":false,"emittedReadable":false,"encoding":null,"endEmitted":false,"ended":false,"errorEmitted":false,"errored":null,"flowing":true,"highWaterMark":16384,"length":0,"multiAwaitDrain":false,"needReadable":true,"objectMode":false,"pipes":[],"readableListening":false,"reading":true,"readingMore":false,"resumeScheduled":false,"sync":false},"_server":null,"_sockname":null,"_writableState":{"afterWriteTickInfo":null,"allBuffers":true,"allNoop":true,"autoDestroy":true,"bufferProcessing":false,"buffered":[],"bufferedIndex":0,"closeEmitted":false,"closed":false,"constructed":true,"corked":0,"decodeStrings":false,"defaultEncoding":"utf8","destroyed":false,"emitClose":false,"ended":true,"ending":true,"errorEmitted":false,"errored":null,"finalCalled":true,"finished":false,"highWaterMark":16384,"length":0,"needDrain":false,"objectMode":false,"pendingcb":1,"prefinished":false,"sync":false,"writecb":null,"writelen":0,"writing":false},"allowHalfOpen":false,"connecting":false,"parser":null,"server":null},"timeoutCb":null,"upgradeOrConnect":false,"useChunkedEncodingByDefault":false,"writable":true},"status":404,"statusText":"Not Found"}
4155
+ info: (Tilebot) Starting Tilebot..
4156
+ info: (Tilebot) settings.API_ENDPOINT:http://localhost:10002
4157
+ info: (Tilebot) settings.TILEBOT_ENDPOINT:http://localhost:10001
4158
+ info: (Tilebot) Log Level: info
4159
+ info: (Tilebot) MAX_STEPS: 1000
4160
+ info: (Tilebot) MAX_EXECUTION_TIME: 28800000
4161
+ info: (Tilebot) Starting Tilebot connector v2.0.10-rc7
4162
+ info: (Tilebot) Using static bots
4163
+ info: (Tilebot) Connecting Redis...
4164
+ info: (Tilebot) Redis connected
4165
+ info: (Tilebot) Tilebot started
4166
+ info: Starting tilebot server...
4167
+ info: (Tilebot) Starting Tilebot..
4168
+ info: (Tilebot) settings.API_ENDPOINT:http://localhost:10002
4169
+ info: (Tilebot) settings.TILEBOT_ENDPOINT:http://localhost:10001
4170
+ info: (Tilebot) Log Level: info
4171
+ info: (Tilebot) MAX_STEPS: 1000
4172
+ info: (Tilebot) MAX_EXECUTION_TIME: 28800000
4173
+ info: (Tilebot) Starting Tilebot connector v2.0.10-rc7
4174
+ info: (Tilebot) Using static bots
4175
+ info: (Tilebot) Connecting Redis...
4176
+ info: (Tilebot) Redis connected
4177
+ info: (Tilebot) Tilebot started
4178
+ info: Tilebot route successfully started.
4179
+ info: Tilebot connector listening on port 10001
4180
+ info: Starting tilebot server...
4181
+ info: (Tilebot) Starting Tilebot..
4182
+ info: (Tilebot) settings.API_ENDPOINT:http://localhost:10002
4183
+ info: (Tilebot) settings.TILEBOT_ENDPOINT:http://localhost:10001
4184
+ info: (Tilebot) Log Level: info
4185
+ info: (Tilebot) MAX_STEPS: 1000
4186
+ info: (Tilebot) MAX_EXECUTION_TIME: 28800000
4187
+ info: (Tilebot) Starting Tilebot connector v2.0.10-rc7
4188
+ info: (Tilebot) Using static bots
4189
+ info: (Tilebot) Connecting Redis...
4190
+ info: (Tilebot) Redis connected
4191
+ info: (Tilebot) Tilebot started
4192
+ info: Tilebot route successfully started.
4193
+ info: Tilebot connector listening on port 10001
4194
+ info: Starting tilebot server...
4195
+ info: (Tilebot) Starting Tilebot..
4196
+ info: (Tilebot) settings.API_ENDPOINT:http://localhost:10002
4197
+ info: (Tilebot) settings.TILEBOT_ENDPOINT:http://localhost:10001
4198
+ info: (Tilebot) Log Level: info
4199
+ info: (Tilebot) MAX_STEPS: 1000
4200
+ info: (Tilebot) MAX_EXECUTION_TIME: 28800000
4201
+ info: (Tilebot) Starting Tilebot connector v2.0.10-rc7
4202
+ info: (Tilebot) Using static bots
4203
+ info: (Tilebot) Connecting Redis...
4204
+ info: (Tilebot) Redis connected
4205
+ info: (Tilebot) Tilebot started
4206
+ info: Tilebot route successfully started.
4207
+ info: Tilebot connector listening on port 10001
4208
+ info: Wait a little (~2s)...
4209
+ info: Wait a little (~3s)...
4210
+ info: Starting tilebot server...
4211
+ info: (Tilebot) Starting Tilebot..
4212
+ info: (Tilebot) settings.API_ENDPOINT:http://localhost:10002
4213
+ info: (Tilebot) settings.TILEBOT_ENDPOINT:http://localhost:10001
4214
+ info: (Tilebot) Log Level: info
4215
+ info: (Tilebot) MAX_STEPS: 1000
4216
+ info: (Tilebot) MAX_EXECUTION_TIME: 28800000
4217
+ info: (Tilebot) Starting Tilebot connector v2.0.10-rc7
4218
+ info: (Tilebot) Using static bots
4219
+ info: (Tilebot) Connecting Redis...
4220
+ info: (Tilebot) Redis connected
4221
+ info: (Tilebot) Tilebot started
4222
+ info: Tilebot route successfully started.
4223
+ info: Tilebot connector listening on port 10001
4224
+ info: Starting tilebot server...
4225
+ info: (Tilebot) Starting Tilebot..
4226
+ info: (Tilebot) settings.API_ENDPOINT:http://localhost:10002
4227
+ info: (Tilebot) settings.TILEBOT_ENDPOINT:http://localhost:10002/modules/tilebot
4228
+ info: (Tilebot) Log Level: info
4229
+ info: (Tilebot) MAX_STEPS: 1000
4230
+ info: (Tilebot) MAX_EXECUTION_TIME: 28800000
4231
+ info: (Tilebot) Starting Tilebot connector v2.0.10-rc7
4232
+ info: (Tilebot) Using static bots
4233
+ info: (Tilebot) Connecting Redis...
4234
+ info: (Tilebot) Redis connected
4235
+ info: (Tilebot) Tilebot started
4236
+ info: Tilebot route successfully started.
4237
+ info: Tilebot connector listening on port 10001
4238
+ info: Starting tilebot server...
4239
+ info: (Tilebot) Starting Tilebot..
4240
+ info: (Tilebot) settings.API_ENDPOINT:http://localhost:10002
4241
+ info: (Tilebot) settings.TILEBOT_ENDPOINT:http://localhost:10001
4242
+ info: (Tilebot) Log Level: info
4243
+ info: (Tilebot) MAX_STEPS: 1000
4244
+ info: (Tilebot) MAX_EXECUTION_TIME: 28800000
4245
+ info: (Tilebot) Starting Tilebot connector v2.0.10-rc7
4246
+ info: (Tilebot) Using static bots
4247
+ info: (Tilebot) Connecting Redis...
4248
+ info: (Tilebot) Redis connected
4249
+ info: (Tilebot) Tilebot started
4250
+ info: Tilebot route successfully started.
4251
+ info: Tilebot connector listening on port 10001
4252
+ info: Starting tilebot server...
4253
+ info: (Tilebot) Starting Tilebot..
4254
+ info: (Tilebot) settings.API_ENDPOINT:http://localhost:10002
4255
+ info: (Tilebot) settings.TILEBOT_ENDPOINT:http://localhost:10001
4256
+ info: (Tilebot) Log Level: info
4257
+ info: (Tilebot) MAX_STEPS: 1000
4258
+ info: (Tilebot) MAX_EXECUTION_TIME: 28800000
4259
+ info: (Tilebot) Starting Tilebot connector v2.0.10-rc7
4260
+ info: (Tilebot) Using static bots
4261
+ info: (Tilebot) Connecting Redis...
4262
+ info: (Tilebot) Redis connected
4263
+ info: (Tilebot) Tilebot started
4264
+ info: Tilebot route successfully started.
4265
+ info: Tilebot connector listening on port 10001
4266
+ error: DirWebRequestV2 Error parsing webRequest jsonBody: "{\"name\":myname,\"email\":\"myemail\"}"
4267
+ Error: {}
4268
+ info: Starting tilebot server...
4269
+ info: (Tilebot) Starting Tilebot..
4270
+ info: (Tilebot) settings.API_ENDPOINT:http://localhost:10002
4271
+ info: (Tilebot) settings.TILEBOT_ENDPOINT:http://localhost:10001
4272
+ info: (Tilebot) Log Level: info
4273
+ info: (Tilebot) MAX_STEPS: 1000
4274
+ info: (Tilebot) MAX_EXECUTION_TIME: 28800000
4275
+ info: (Tilebot) Starting Tilebot connector v2.0.10-rc7
4276
+ info: (Tilebot) Using static bots
4277
+ info: (Tilebot) Connecting Redis...
4278
+ info: (Tilebot) Redis connected
4279
+ info: (Tilebot) Tilebot started
4280
+ info: Tilebot route successfully started.
4281
+ info: Tilebot connector listening on port 10001
4282
+ info: Redis: value; value: 1
4283
+ info: Redis: value; value: Andrea
4284
+ info: Redis: value; value: Luis
4285
+ info: Redis: value; value: [object Object]
4286
+ info: Redis: value; value: [object Object]
4287
+ info: Redis: total; value: 4
4288
+ info: Redis: total; value: 4
4289
+ info: Redis: total; value: Francesco Latino Tiledesk
4290
+ info: Redis: summary; value: andrea sponziello tiledesk
4291
+ error: (DirSetAttribute) Invalid action: {"0":{"argument":"operands","instance":{"operators":["addAsNumber","subtractAsNumber","divideAsNumber","multiplyAsNumber"]},"message":"requires property \"operands\"","name":"required","path":["operation"],"property":"instance.operation","schema":{"additionalProperties":false,"properties":{"operands":{"items":{"additionalProperties":false,"if":{"properties":{"isVariable":{"const":true}}},"properties":{"function":{"enum":["capitalizeAsString","upperCaseAsString","lowerCaseAsString","absAsNumber","ceilAsNumber","floorAsNumber","roundAsNumber"],"type":"string"},"isVariable":{"type":"boolean"},"value":{"type":"string"}},"required":["value","isVariable"],"then":{"properties":{"value":{"pattern":"^[a-zA-Z_]*[a-zA-Z_]+[a-zA-Z0-9_]*$"}}},"type":"object"},"minItems":1,"type":"array"},"operators":{"items":{"enum":["addAsNumber","addAsString","subtractAsNumber","multiplyAsNumber","divideAsNumber"],"type":"string"},"type":"array"}},"required":["operands"],"type":"object"},"stack":"instance.operation requires property \"operands\""}}
4292
+ error: (DirSetAttribute) Invalid action: {"0":{"argument":"_tdActionType","instance":{},"message":"requires property \"_tdActionType\"","name":"required","path":[],"property":"instance","schema":{"additionalProperties":false,"properties":{"_tdActionId":{"type":["string","null"]},"_tdActionTitle":{"type":["string","null"]},"_tdActionType":{"enum":["setattribute"],"type":"string"},"destination":{"type":"string"},"operation":{"additionalProperties":false,"properties":{"operands":{"items":{"additionalProperties":false,"if":{"properties":{"isVariable":{"const":true}}},"properties":{"function":{"enum":["capitalizeAsString","upperCaseAsString","lowerCaseAsString","absAsNumber","ceilAsNumber","floorAsNumber","roundAsNumber"],"type":"string"},"isVariable":{"type":"boolean"},"value":{"type":"string"}},"required":["value","isVariable"],"then":{"properties":{"value":{"pattern":"^[a-zA-Z_]*[a-zA-Z_]+[a-zA-Z0-9_]*$"}}},"type":"object"},"minItems":1,"type":"array"},"operators":{"items":{"enum":["addAsNumber","addAsString","subtractAsNumber","multiplyAsNumber","divideAsNumber"],"type":"string"},"type":"array"}},"required":["operands"],"type":"object"}},"required":["_tdActionType","destination","operation"],"type":"object"},"stack":"instance requires property \"_tdActionType\""},"1":{"argument":"destination","instance":{},"message":"requires property \"destination\"","name":"required","path":[],"property":"instance","schema":{"additionalProperties":false,"properties":{"_tdActionId":{"type":["string","null"]},"_tdActionTitle":{"type":["string","null"]},"_tdActionType":{"enum":["setattribute"],"type":"string"},"destination":{"type":"string"},"operation":{"additionalProperties":false,"properties":{"operands":{"items":{"additionalProperties":false,"if":{"properties":{"isVariable":{"const":true}}},"properties":{"function":{"enum":["capitalizeAsString","upperCaseAsString","lowerCaseAsString","absAsNumber","ceilAsNumber","floorAsNumber","roundAsNumber"],"type":"string"},"isVariable":{"type":"boolean"},"value":{"type":"string"}},"required":["value","isVariable"],"then":{"properties":{"value":{"pattern":"^[a-zA-Z_]*[a-zA-Z_]+[a-zA-Z0-9_]*$"}}},"type":"object"},"minItems":1,"type":"array"},"operators":{"items":{"enum":["addAsNumber","addAsString","subtractAsNumber","multiplyAsNumber","divideAsNumber"],"type":"string"},"type":"array"}},"required":["operands"],"type":"object"}},"required":["_tdActionType","destination","operation"],"type":"object"},"stack":"instance requires property \"destination\""},"2":{"argument":"operation","instance":{},"message":"requires property \"operation\"","name":"required","path":[],"property":"instance","schema":{"additionalProperties":false,"properties":{"_tdActionId":{"type":["string","null"]},"_tdActionTitle":{"type":["string","null"]},"_tdActionType":{"enum":["setattribute"],"type":"string"},"destination":{"type":"string"},"operation":{"additionalProperties":false,"properties":{"operands":{"items":{"additionalProperties":false,"if":{"properties":{"isVariable":{"const":true}}},"properties":{"function":{"enum":["capitalizeAsString","upperCaseAsString","lowerCaseAsString","absAsNumber","ceilAsNumber","floorAsNumber","roundAsNumber"],"type":"string"},"isVariable":{"type":"boolean"},"value":{"type":"string"}},"required":["value","isVariable"],"then":{"properties":{"value":{"pattern":"^[a-zA-Z_]*[a-zA-Z_]+[a-zA-Z0-9_]*$"}}},"type":"object"},"minItems":1,"type":"array"},"operators":{"items":{"enum":["addAsNumber","addAsString","subtractAsNumber","multiplyAsNumber","divideAsNumber"],"type":"string"},"type":"array"}},"required":["operands"],"type":"object"}},"required":["_tdActionType","destination","operation"],"type":"object"},"stack":"instance requires property \"operation\""}}
4293
+ error: (DirSetAttribute) Invalid action: operators === undefined && operands.length !== 1
4294
+ error: (DirSetAttribute) Invalid action: operators.length !== operands.length - 1
4295
+ error: (DirSetAttribute) Invalid action: {"0":{"argument":"^[a-zA-Z_]*[a-zA-Z_]+[a-zA-Z0-9_]*$","instance":"inject(here);","message":"does not match pattern \"^[a-zA-Z_]*[a-zA-Z_]+[a-zA-Z0-9_]*$\"","name":"pattern","path":["operation","operands",0,"value"],"property":"instance.operation.operands[0].value","schema":{"pattern":"^[a-zA-Z_]*[a-zA-Z_]+[a-zA-Z0-9_]*$"},"stack":"instance.operation.operands[0].value does not match pattern \"^[a-zA-Z_]*[a-zA-Z_]+[a-zA-Z0-9_]*$\""}}
4296
+ error: (DirSetAttribute) Invalid action: {"0":{"argument":"^[a-zA-Z_]*[a-zA-Z_]+[a-zA-Z0-9_]*$","instance":"inject(here);","message":"does not match pattern \"^[a-zA-Z_]*[a-zA-Z_]+[a-zA-Z0-9_]*$\"","name":"pattern","path":["operation","operands",1,"value"],"property":"instance.operation.operands[1].value","schema":{"pattern":"^[a-zA-Z_]*[a-zA-Z_]+[a-zA-Z0-9_]*$"},"stack":"instance.operation.operands[1].value does not match pattern \"^[a-zA-Z_]*[a-zA-Z_]+[a-zA-Z0-9_]*$\""}}
4297
+ warn: DirIfOnlineAgents Incorrect directive:
4298
+ warn: DirIfOnlineAgents Incorrect directive:
4299
+ info: Starting tilebot server...
4300
+ info: (Tilebot) Starting Tilebot..
4301
+ info: (Tilebot) settings.API_ENDPOINT:http://localhost:10002
4302
+ info: (Tilebot) settings.TILEBOT_ENDPOINT:http://localhost:10001
4303
+ info: (Tilebot) Log Level: info
4304
+ info: (Tilebot) MAX_STEPS: 1000
4305
+ info: (Tilebot) MAX_EXECUTION_TIME: 28800000
4306
+ info: (Tilebot) Starting Tilebot connector v2.0.10-rc7
4307
+ info: (Tilebot) Using static bots
4308
+ info: (Tilebot) Connecting Redis...
4309
+ info: (Tilebot) Redis connected
4310
+ info: (Tilebot) Tilebot started
4311
+ info: Tilebot route successfully started.
4312
+ info: Tilebot connector listening on port 10001
4313
+ info: Starting tilebot server...
4314
+ info: (Tilebot) Starting Tilebot..
4315
+ info: (Tilebot) settings.API_ENDPOINT:http://localhost:10002
4316
+ info: (Tilebot) settings.TILEBOT_ENDPOINT:http://localhost:10001
4317
+ info: (Tilebot) Log Level: info
4318
+ info: (Tilebot) MAX_STEPS: 1000
4319
+ info: (Tilebot) MAX_EXECUTION_TIME: 28800000
4320
+ info: (Tilebot) Starting Tilebot connector v2.0.10-rc7
4321
+ info: (Tilebot) Using static bots
4322
+ info: (Tilebot) Connecting Redis...
4323
+ info: (Tilebot) Redis connected
4324
+ info: (Tilebot) Tilebot started
4325
+ info: Tilebot route successfully started.
4326
+ info: Tilebot connector listening on port 10001
4327
+ error: (TiledeskExpression) evaluateJavascriptExpression error: Unexpected token ']' - while evaluating the following expression: '$data.andrea[].{ === undefined'
4328
+ error: (TiledeskExpression) evaluateJavascriptExpression error: Unexpected token ']' - while evaluating the following expression: 'Number($data.varName) === Number($data.var[].{)'
4329
+ error: (TiledeskExpression) evaluateJavascriptExpression error: missing ) after argument list - while evaluating the following expression: 'Number($data.age()...[) < Number("10")'
4330
+ error: (TiledeskExpression)Condition evaluation stopped because of invalid operand2 [object Object]
4331
+ error: (TiledeskExpression) Condition evaluation stopped because of invalid operand1 11height
4332
+ error: (TiledeskExpression) Invalid JSON Group expression {"conditions":[{"operand1":"11height","operand2":{"type":"const","value":"1"},"operator":"greaterThan","type":"condition"},{"operator":"AND","type":"operator"},{"operand1":"name","operand2":{"type":"const","value":"And"},"operator":"startsWith","type":"condition"}],"type":"expression"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiledesk/tiledesk-tybot-connector",
3
- "version": "2.0.10-rc7",
3
+ "version": "2.0.10-rc8",
4
4
  "description": "Tiledesk Tybot connector",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -57,6 +57,7 @@ const { DirReplaceBotV3 } = require('./directives/DirReplaceBotV3');
57
57
  const { DirAiTask, DirAiPrompt } = require('./directives/DirAiPrompt');
58
58
  const { DirWebResponse } = require('./directives/DirWebResponse');
59
59
  const { DirConnectBlock } = require('./directives/DirConnectBlock');
60
+ const { DirAddKbContent } = require('./directives/DirAddKbContent');
60
61
 
61
62
  const winston = require('../utils/winston');
62
63
  const { DirFlowLog } = require('./directives/DirFlowLog');
@@ -721,6 +722,12 @@ class DirectivesChatbotPlug {
721
722
  this.process(next_dir);
722
723
  })
723
724
  }
725
+ else if (directive_name === Directives.ADD_KB_CONTENT) {
726
+ new DirAddKbContent(context).execute(directive, async () => {
727
+ let next_dir = await this.nextDirective(this.directives);
728
+ this.process(next_dir);
729
+ });
730
+ }
724
731
  else {
725
732
  let next_dir = await this.nextDirective(this.directives);
726
733
  this.process(next_dir);
@@ -0,0 +1,331 @@
1
+ const axios = require("axios").default;
2
+ const { TiledeskChatbot } = require('../../engine/TiledeskChatbot');
3
+ const { Filler } = require('../Filler');
4
+ let https = require("https");
5
+ const { DirIntent } = require("./DirIntent");
6
+ const { TiledeskChatbotConst } = require("../../engine/TiledeskChatbotConst");
7
+ const { TiledeskChatbotUtil } = require("../../utils/TiledeskChatbotUtil");
8
+ const assert = require("assert");
9
+ require('dotenv').config();
10
+ const winston = require('../../utils/winston');
11
+ const httpUtils = require("../../utils/HttpUtils");
12
+ const integrationService = require("../../services/IntegrationService");
13
+ const { Logger } = require("../../Logger");
14
+
15
+ class DirAddKbContent {
16
+
17
+ constructor(context) {
18
+ if (!context) {
19
+ throw new Error('context object is mandatory');
20
+ }
21
+ this.context = context;
22
+ this.chatbot = context.chatbot;
23
+ this.tdcache = this.context.tdcache;
24
+ this.requestId = this.context.requestId;
25
+ this.projectId = this.context.projectId;
26
+ this.token = this.context.token;
27
+ this.intentDir = new DirIntent(context);
28
+ this.API_ENDPOINT = this.context.API_ENDPOINT;
29
+ this.log = context.log;
30
+ this.logger = new Logger({ request_id: this.requestId, dev: this.context.supportRequest.draft });
31
+ }
32
+
33
+ execute(directive, callback) {
34
+ this.logger.info("Execute AskKnowledgeBase action")
35
+ winston.debug("DirAskGPTV2 directive: ", directive);
36
+ let action;
37
+ if (directive.action) {
38
+ action = directive.action;
39
+ }
40
+ else {
41
+ this.logger.error("Incorrect action for ", directive.name, directive)
42
+ winston.debug("DirAskGPTV2 Incorrect directive: ", directive);
43
+ callback();
44
+ return;
45
+ }
46
+ this.go(action, (stop) => {
47
+ this.logger.info("Acion AskKnowledgeBase completed");
48
+ callback(stop);
49
+ })
50
+ }
51
+
52
+ async go(action, callback) {
53
+ winston.debug("[DirAddKbContent] action:", action);
54
+ if (!this.tdcache) {
55
+ winston.error("[DirAddKbContent] Error: tdcache is mandatory");
56
+ callback();
57
+ return;
58
+ }
59
+
60
+ let publicKey = false;
61
+ let type = action.type;
62
+ let name = action.name;
63
+ let content = action.content;
64
+ let engine;
65
+
66
+ // default values
67
+ let namespace = this.context.projectId;
68
+
69
+ if (action.namespace) {
70
+ namespace = action.namespace;
71
+ }
72
+
73
+ let requestVariables = null;
74
+ requestVariables =
75
+ await TiledeskChatbot.allParametersStatic(
76
+ this.tdcache, this.requestId
77
+ );
78
+
79
+ const filler = new Filler();
80
+ const filled_content = filler.fill(content, requestVariables);
81
+
82
+ const kb_endpoint = process.env.API_ENDPOINT;
83
+ winston.verbose("[DirAddKbContent] KbEndpoint URL: " + kb_endpoint);
84
+
85
+ let key = await integrationService.getKeyFromIntegrations(this.projectId, 'openai', this.token);
86
+ if (!key) {
87
+ this.logger.debug("[DirAddKbContent] OpenAI key not found in Integration. Using shared OpenAI key");
88
+ winston.verbose("[DirAddKbContent] - Key not found in Integrations. Searching in kb settings...");
89
+ key = await this.getKeyFromKbSettings();
90
+ }
91
+
92
+ if (!key) {
93
+ winston.verbose("[DirAddKbContent] - Retrieve public gptkey")
94
+ key = process.env.GPTKEY;
95
+ publicKey = true;
96
+ } else {
97
+ this.logger.debug("[DirAddKbContent] use your own OpenAI key")
98
+ }
99
+
100
+ if (!key) {
101
+ winston.info("[DirAddKbContent] Error: gptkey is mandatory");
102
+ await this.chatbot.addParameter("flowError", "[DirAddKbContent] Error: gptkey is mandatory");
103
+ callback();
104
+ return;
105
+ }
106
+
107
+ if (publicKey === true) {
108
+ let keep_going = await this.checkQuoteAvailability();
109
+ if (keep_going === false) {
110
+ this.logger.warn("[DirAddKbContent] Tokens quota exceeded. Skip the action")
111
+ winston.verbose("[DirAddKbContent] - Quota exceeded for tokens. Skip the action")
112
+ await this.chatbot.addParameter("flowError", "[DirAddKbContent] Error: tokens quota exceeded");
113
+ callback(true);
114
+ return;
115
+ }
116
+ }
117
+
118
+ let ns;
119
+
120
+ if (action.namespaceAsName) {
121
+ // Namespace could be an attribute
122
+ const filled_namespace = filler.fill(action.namespace, requestVariables)
123
+ this.logger.debug("[DirAddKbContent] Searching namespace by name ", filled_namespace);
124
+ ns = await this.getNamespace(filled_namespace, null);
125
+ namespace = ns?.id;
126
+ winston.verbose("[DirAddKbContent] - Retrieved namespace id from name " + namespace);
127
+ } else {
128
+ this.logger.debug("[DirAddKbContent] Searching namespace by id ", namespace);
129
+ ns = await this.getNamespace(null, namespace);
130
+ }
131
+
132
+ if (!ns) {
133
+ this.logger.error("[DirAddKbContent] Namespace not found");
134
+ await this.chatbot.addParameter("flowError", "[DirAddKbContent] Error: namespace not found");
135
+ callback();
136
+ return;
137
+ }
138
+
139
+ if (ns.engine) {
140
+ engine = ns.engine;
141
+ } else {
142
+ engine = await this.setDefaultEngine()
143
+ }
144
+
145
+ if (!namespace) {
146
+ this.logger.error("[DirAddKbContent] Namespace is undefined")
147
+ winston.verbose("[DirAddKbContent] - Error: namespace is undefined")
148
+ await this.chatbot.addParameter("flowError", "[DirAddKbContent] Error: namespace is undefined");
149
+ callback(true);
150
+ return;
151
+ }
152
+
153
+ let json = {
154
+ content: filled_content,
155
+ namespace: namespace,
156
+ type: type,
157
+ name: name,
158
+ source: name
159
+ };
160
+
161
+ winston.debug("[DirAddKbContent] json:", json);
162
+
163
+ const HTTPREQUEST = {
164
+ url: kb_endpoint + "/" + this.projectId + "/kb",
165
+ headers: {
166
+ 'Content-Type': 'application/json',
167
+ 'Authorization': 'JWT ' + this.context.token
168
+ },
169
+ json: json,
170
+ method: "POST"
171
+ }
172
+ winston.debug("[DirAddKbContent] HttpRequest: ", HTTPREQUEST);
173
+
174
+ httpUtils.request(
175
+ HTTPREQUEST, async (err, resbody) => {
176
+
177
+ if (err) {
178
+ this.logger.error("[DirAddKbContent] error: " + JSON.stringify(err?.response));
179
+ winston.error("[DirAddKbContent] error: ", err?.response);
180
+ if (callback) {
181
+ callback();
182
+ return;
183
+ }
184
+ }
185
+ else if (resbody.success === true) {
186
+ winston.debug("[DirAddKbContent] resbody: ", resbody);
187
+ callback();
188
+ return;
189
+ } else {
190
+ callback();
191
+ return;
192
+ }
193
+ }
194
+ )
195
+ }
196
+
197
+ async getKeyFromKbSettings() {
198
+ return new Promise((resolve) => {
199
+
200
+ const KB_HTTPREQUEST = {
201
+ url: this.API_ENDPOINT + "/" + this.context.projectId + "/kbsettings",
202
+ headers: {
203
+ 'Content-Type': 'application/json',
204
+ 'Authorization': 'JWT ' + this.context.token
205
+ },
206
+ method: "GET"
207
+ }
208
+ winston.debug("DirAskGPTV2 KB HttpRequest", KB_HTTPREQUEST);
209
+
210
+ httpUtils.request(
211
+ KB_HTTPREQUEST, async (err, resbody) => {
212
+ if (err) {
213
+ winston.error("DirAskGPTV2 Get kb settings error ", err?.response?.data);
214
+ resolve(null);
215
+ } else {
216
+ if (!resbody.gptkey) {
217
+ resolve(null);
218
+ } else {
219
+ resolve(resbody.gptkey);
220
+ }
221
+ }
222
+ }
223
+ )
224
+ })
225
+ }
226
+
227
+ async checkQuoteAvailability() {
228
+ return new Promise((resolve) => {
229
+
230
+ const HTTPREQUEST = {
231
+ url: this.API_ENDPOINT + "/" + this.context.projectId + "/quotes/tokens",
232
+ headers: {
233
+ 'Content-Type': 'application/json',
234
+ 'Authorization': 'JWT ' + this.context.token
235
+ },
236
+ method: "GET"
237
+ }
238
+ winston.debug("DirAskGPTV2 check quote availability HttpRequest", HTTPREQUEST);
239
+
240
+ httpUtils.request(
241
+ HTTPREQUEST, async (err, resbody) => {
242
+ if (err) {
243
+ winston.error("DirAskGPTV2 Check quote availability err: ", err);
244
+ resolve(true)
245
+ } else {
246
+ if (resbody.isAvailable === true) {
247
+ resolve(true)
248
+ } else {
249
+ resolve(false)
250
+ }
251
+ }
252
+ }
253
+ )
254
+ })
255
+ }
256
+
257
+ async updateQuote(tokens_usage) {
258
+ return new Promise((resolve, reject) => {
259
+
260
+ const HTTPREQUEST = {
261
+ url: this.API_ENDPOINT + "/" + this.context.projectId + "/quotes/incr/tokens",
262
+ headers: {
263
+ 'Content-Type': 'application/json',
264
+ 'Authorization': 'JWT ' + this.context.token
265
+ },
266
+ json: tokens_usage,
267
+ method: "POST"
268
+ }
269
+ winston.debug("DirAskGPTV2 update quote HttpRequest ", HTTPREQUEST);
270
+
271
+ httpUtils.request(
272
+ HTTPREQUEST, async (err, resbody) => {
273
+ if (err) {
274
+ winston.error("DirAskGPTV2 Increment tokens quote err: ", err);
275
+ reject(false)
276
+ } else {
277
+ resolve(true);
278
+ }
279
+ }
280
+ )
281
+ })
282
+ }
283
+
284
+ async getNamespace(name, id) {
285
+ return new Promise((resolve) => {
286
+ const HTTPREQUEST = {
287
+ url: this.API_ENDPOINT + "/" + this.context.projectId + "/kb/namespace/all",
288
+ headers: {
289
+ 'Content-Type': 'application/json',
290
+ 'Authorization': 'JWT ' + this.context.token
291
+ },
292
+ method: "GET"
293
+ }
294
+ winston.debug("DirAskGPTV2 get all namespaces HttpRequest", HTTPREQUEST);
295
+ httpUtils.request(
296
+ HTTPREQUEST, async (err, namespaces) => {
297
+ if (err) {
298
+ winston.error("DirAskGPTV2 get all namespaces err: ", err);
299
+ resolve(null)
300
+ } else {
301
+ winston.debug("DirAskGPTV2 get all namespaces resbody: ", namespaces);
302
+ if (name) {
303
+ let namespace = namespaces.find(n => n.name === name);
304
+ resolve(namespace);
305
+ } else {
306
+ let namespace = namespaces.find(n => n.id === id);
307
+ resolve(namespace);
308
+ }
309
+
310
+ }
311
+ }
312
+ )
313
+ })
314
+ }
315
+
316
+ async setDefaultEngine() {
317
+ return new Promise((resolve) => {
318
+ let engine = {
319
+ name: "pinecone",
320
+ type: process.env.PINECONE_TYPE,
321
+ apikey: "",
322
+ vector_size: 1536,
323
+ index_name: process.env.PINECONE_INDEX
324
+ }
325
+ resolve(engine);
326
+ })
327
+ }
328
+
329
+ }
330
+
331
+ module.exports = { DirAddKbContent }
@@ -61,6 +61,7 @@ class Directives {
61
61
  static WEBHOOK = 'webhook';
62
62
  static WEB_RESPONSE = "web_response";
63
63
  static FLOW_LOG = "flow_log";
64
+ static ADD_KB_CONTENT = "add_kb_content";
64
65
 
65
66
  // static WHEN_ONLINE_MOVE_TO_AGENT = "whenonlinemovetoagent"; // DEPRECATED?
66
67
  // static WHEN_OFFLINE_HOURS = "whenofflinehours"; // DEPRECATED // adds a message on top of the original message when offline hours opts: --replace