n4ze3m / dialoqbase

Create chatbots with ease
https://dialoqbase.n4ze3m.com/
MIT License
1.53k stars 251 forks source link

Question - api bot message statistics #223

Closed ferstpetr777 closed 3 months ago

ferstpetr777 commented 4 months ago

Nazim good day ! Could you please tell me in which table the history of bot's messages is saved when there is a connection via bot's API ?

n4ze3m commented 4 months ago

Hey, unfortunately, the current API request is not being saved in a table

PeterBusalov commented 4 months ago

Nazim Greetings! please tell me, maybe you have an idea how to analyze API activity to count bot tokens ?

n4ze3m commented 4 months ago

You can add a check in the API handler for counting tokens. You can use the 'js-tiktoken' package

PeterBusalov commented 4 months ago

Nazim Afternoon! You know the code of this project very well. Can you please tell me the logic, how can you make it possible to intercept all incoming and outgoing messages to AI models by API open ai? To record them into a database for statistics.

n4ze3m commented 3 months ago

Hey, I have added a new table for the API integration, similar to other integrations.

PeterBusalov commented 3 months ago

Great! Thank you ! as soon as we do all the statistics I will report back how we organized everything , as a basis we took meta base , it was suitable as a universal ready api gjl connectable to docker databases