API call using a stored template

I don’t think this is possible, but figured I would double check…

Is there a way to create a prompt with a few variables inside the prompt and then save that as a template inside of the AI so that you are not having to submit the entire prompt every time? That way I can just send the few variables that change each time and still receive the desired results. Everything I have found so far seems to suggest that I would need to store the template on my end and then submit the entire prompt which defeats the purpose. I’m trying to find a way to send less since it seems rather wasteful to keep sending the same giant prompt over and over again instead of just the few pieces of changed information.

It appears this might be achieved with threads, but that seems like I would still need to submit the entire thread each time to get the proper prompt response , which ultimately is probably no different than me just storing it on my end and sending the whole thing over and over. Plus the prompts say they last for 60 days, which I would need this to remain working indefinitely.

Thanks,
Wil

4 Likes

Hi Wil! The closest is using prompt caching, but this requires that you have the first 1024 of your prompt (system prompt + user prompt) constant. Assuming you have that and can add the dynamic part afterwards, majority of it will be cached and you will pay significantly less

3 Likes

Thank you! I will look into the prompt caching and see if I can make that work in this case. Much appreciated.

2 Likes