Data-Driven Chat-Bot for user-data

Hello,

I am developing a chat bot that should answer questions about the data of a user.

The data is stored in a platfrom and can be queried via REST-Calls.

My question is what is the best practice to generate data-driven answers for user-question?

I have two approaches in mind

  1. Function-Calling and add the data to the Context (Problem context-size)
  2. Let the modell generate Code that queries the data and insert the data after the answer is generated

Do you have any other architectures in mind? Any feedback is appriciated.

Personally I would combine the two approaches depending on the user’s question. Depending on the users’ question, either approach may be more effective.

Thank you. Do you have any rule of thumb where to decide between the two methods?