mirror of
https://github.com/marcogll/builderbot-openai-assistants.git
synced 2026-01-13 13:25:18 +00:00
@@ -13,10 +13,10 @@ const welcomeFlow = addKeyword<Provider, Database>(EVENTS.WELCOME)
|
||||
.addAction(async (ctx, { flowDynamic, state, provider }) => {
|
||||
await typing(ctx, provider)
|
||||
const response = await toAsk(ASSISTANT_ID, ctx.body, state)
|
||||
const chunks = response.split(/(?<!\d)\.\s+/g);
|
||||
for (const chunk of chunks) {
|
||||
const chunks = response.split(/\n\n+/);
|
||||
for (const chunk of chunks) {
|
||||
await flowDynamic([{ body: chunk.trim() }]);
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
const main = async () => {
|
||||
|
||||
Reference in New Issue
Block a user