Task: Add PDF readers
Ворклоги
By the way, this parsing of 32 PDF pages cost about $0.16

To begin with, I added a parser via OpenRouter with preliminary pagination. The speed and cost were surprising. The analysis time for a single-page document is about 8 seconds.

And as for the cost – tenths of a cent.

A bulkier document – 3.2 megabytes, 32 pages.
It took significantly longer – almost 5 minutes.

But this is simply a flaw in the queuing – each page was parsed sequentially, whereas it should be done in batches. I just need to refine the logic so that one page doesn't block another, while not sending everything at once either – otherwise, you might hit rate limit errors. Although for now in the current project, I'll make it send all at once to test whether a rate limit error occurs or not. ChatGPT says that OpenRouter doesn't impose its own limits on paid models, but limits can come from the ultimate provider.
Добавил отправку всех страниц батчем (ну и параметр конечно, можно батчем, а можно последовательно).
В итоге 32 страницы отработало за 21 секунду, вместо 4 с половиной минуты. Стоимость все та же = $.016 за все страницы. Как по мне, так очень хороший результат.
