I’m working on a task where I need to interact with the OpenAI API to handle dynamic prayer requests. The problem I want to solve is optimizing token usage.
Here’s my current approach:
I have a static system instruction that defines the assistant’s behavior (e.g., responding to prayer requests with empathy).
The user’s prayer request is dynamic and changes every time.
I want to send only the dynamic part (the prayer request) in each request, while keeping the static part (the system instruction) consistent for every request.
My goal is to reduce the token usage while ensuring the assistant responds appropriately to the user’s request.
I tried to send the static part as part of the prompt in every request, but I’m looking for a more efficient way to only send the dynamic part while still maintaining context. Is there a better way to achieve this with the OpenAI API?
Also, I would like to track token usage to ensure I’m optimizing the calls as much as possible.
Can anyone suggest a way to do this efficiently?