OpenAIPydanticProgram token limit #10425
Replies: 1 comment 1 reply
-
🤖 Hey @lalitmoharana07, great to see you back here! Hope you're doing well. To handle the token limit issue in OpenAIPydanticProgram when extracting structural data from large PDF documents, you can adjust the Here is an example of how you can do this: from llama_index.node_parser.text.token import TokenTextSplitter
# Initialize TokenTextSplitter with a larger chunk size
splitter = TokenTextSplitter(chunk_size=5000) # Increase chunk_size as needed
# Use the splitter to split your text
chunks = splitter.split_text(your_large_text) Please replace Remember that if you increase the Also, be aware that if the metadata length is longer than the chunk size, or if the resulting chunks are less than 50 tokens, a You can find more details in the llama_index/node_parser/text/token.py file. As for the maximum token limit in OpenAIPydanticProgram when extracting structural data from PDF documents, I wasn't able to find an answer within the repository. The token limit might be dependent on the specific implementation of the OpenAIPydanticProgram you are using, or it might be a limit set by the underlying PDF extraction library. If you could provide more details about the error message you're seeing or the specific circumstances under which you encounter the token limit, I might be able to provide a more specific solution. SourcesThis response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi ,
i an using OpenAIPydanticProgram for extraction of structural data from pdf documents ,
here i am facing an issue related to token limit how can i handle token limit issue if i have more content.
Beta Was this translation helpful? Give feedback.
All reactions