I have a long piece of text (~500 tokens) I want to extract multiple information from. Since the extraction process is quite complex and the different kinds of information I want to extract differ semantically, I do not believe I can use just one prompt to extract it all.
So I was wondering if there was any way I could encode the long piece of text only once and use it in multiple API calls so I would not have to pay the cost of encoding the context multiple times.
Something like this:
- API call 1: encode "very long piece of text" -> context
- API call 2: completion of ({context} + "What is A?")
- API call 3: completion of ({context} + "What is B?")
Again, the idea is that I do not have to encode the context multiple times. I actually asked ChatGPT and it said there was a context property in each choice in the response - which does not exist according to the API documentation.
Any tips?