Using Assistant API to Automatically Generate Documents

Hi, I built a chatbot using the Assistant’s API with the goal of automating the creation of onboarding documents, such as NDAs and offer letters. These documents typically only require minor changes, like updating the recipient’s name, job title, and dates. I provided the assistant with several example PDFs, hoping it would generate new documents based on those templates. However, despite my attempts, the assistant often deviates from the format and structure of the original documents.

Is there a way to ensure the chatbot accurately replicates the structure while only adjusting the necessary details?