Ivan i think that is the hard way to do it, though potentially can work of course.
It's more about your use case you have to think about because there is a semantic search via an AI-assisted bot for a whole conversation and then there is a simple semantic search to retrieve a whole article in Confluence and then there is Q&A - semantic search with direct short summarised answers.
If you tell me your use case i may be able to help answer your question more thoroughly as you can build an API from the ground up that will also do post-processing or you can use an off-the shelf API that will retrieve the article in full and then there is the conversation bot which is a whole different piece of cake, and there is an answer to that which was called an AI Assitant from OPenAI but now they are called GPT's. I have created 2 there under Webdadi and the Webdadi Support public GPT available with ChatGPT Plus subscription uses my Confluence Q&A AI API that integrates with the GPT. The problem with this is currently the GPT is only available to ChatGPT Plus users, not the wider public, so you would have to build your own
Here is my documented solution for how to create semantic search and post-process a Confluence Article for use in a Q&A paradigm - so ask a Natural language question and get an answer based on that question - its not a chatbot itself with conversation - pure Q&A:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.