langchain
langchain copied to clipboard
How to handle a long prompt?
Hi, if we need to pass a long prompt to the openai LLM, what is the general strategy to handle this?
Summarize then pass it as a single prompt that fits inside the window? Or split the long prompt into multiple smaller ones, each send smaller prompt to the openai API, and summarize the combined results from the multiple smaller prompts? Is there an example on how to do the later?
Thank you
i would check out the map_reduce method in the following documentation: https://langchain.readthedocs.io/en/latest/use_cases/summarization.html
does that answer your question
Yes it does! Trying it out now :) Thanks