You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
langchain/langchain
vertinski 65f3a341b0
Prompt fix for empty intermediate steps in summarization (#660)
Adding quotation marks around {text} avoids generating empty or
completely random responses from OpenAI davinci-003. Empty or completely
unrelated intermediate responses in summarization messes up the final
result or makes it very inaccurate.
The error from OpenAI would be: "The model predicted a completion that
begins with a stop sequence, resulting in no output. Consider adjusting
your prompt or stop sequences."
This fix corrects the prompting for summarization chain. This works on
API too, the images are for demonstrative purposes.
This approach can be applied to other similar prompts too. 

Examples:

1) Without quotation marks
![Screenshot from 2023-01-20
07-18-19](https://user-images.githubusercontent.com/22897470/213624365-9dfc18f9-5f3f-45d2-abe1-56de67397e22.png)

2) With quotation marks
![Screenshot from 2023-01-20
07-18-35](https://user-images.githubusercontent.com/22897470/213624478-c958e742-a4a7-46fe-a163-eca6326d9dae.png)
2 years ago
..
agents Add documentation for custom prompts for Agents (#631) (#640) 2 years ago
callbacks Add BaseCallbackHandler and CallbackManager (#478) 2 years ago
chains Prompt fix for empty intermediate steps in summarization (#660) 2 years ago
docstore Harrison/wiki update (#622) 2 years ago
embeddings Fix CohereError: embed is not an available endpoint on this model (#637) 2 years ago
evaluation bump version to 0063 (#616) 2 years ago
llms Harrison/cohere experimental (#638) 2 years ago
prompts more complex sql chain (#619) 2 years ago
utilities Harrison/bing wrapper (#656) 2 years ago
vectorstores Add ids parameter for pinecone from_texts / add_texts (#659) 2 years ago
__init__.py Harrison/wolfram alpha (#579) 2 years ago
cache.py fix caching (#658) 2 years ago
example_generator.py Harrison/improve cache (#368) 2 years ago
formatting.py initial commit 2 years ago
input.py Add BaseCallbackHandler and CallbackManager (#478) 2 years ago
model_laboratory.py Harrison/improve cache (#368) 2 years ago
py.typed Add py.typed marker to package (#121) 2 years ago
python.py Harrison/tools exp (#372) 2 years ago
requests.py LLMRequestsChain (#267) 2 years ago
schema.py Add finish reason to Generation for usage downstream (#526) 2 years ago
serpapi.py expose more serpapi parameters (#609) 2 years ago
sql_database.py more complex sql chain (#619) 2 years ago
text_splitter.py [Minor Fix] Fix spacy TextSplitter init (#606) 2 years ago
utils.py Harrison/bing wrapper (#656) 2 years ago