Regarding Open AI costs when llama index data loading and responding. For my use case I'm using a Restful API to access handle requests.
I've done a quick test of llama index as a simple query endpoint, let's say:
def query(question: Union[str, None] = None):
documents = SimpleWebPageReader(html_to_text=True)
.load_data(["https://docs.foobar.com/some-knowledge"])
index = SummaryIndex.from_documents(documents)
query_engine = index.as_query_engine()
answer = query_engine.query(question)
return { "answer": str(answer )}
It can be determined that for every GET query request there's an associated cost.
Since each computation over Open AI has a cost, I would like to know how costly the operation is for the query endpoint above.
I'm assuming that the
SimpleWebPageReader.load_data
and query
question
goes on a single request to Open AI and not two or more?