Stop OpenAI chat from emitting reference notes directly in chat body

The Chat models sometime output reference notes directly in the chat
body in unformatted form, specifically as Notes:\n['. Prevent that.
Reference notes are shown in clean, formatted form anyway
This commit is contained in:
Debanjum Singh Solanky
2023-11-10 22:27:24 -08:00
parent 8585976f37
commit cba371678d
2 changed files with 5 additions and 3 deletions

View File

@@ -134,4 +134,5 @@ def converse(
temperature=temperature,
openai_api_key=api_key,
completion_func=completion_func,
model_kwargs={"stop": ["Notes:\n["]},
)