diff --git a/docs/modules/memory/how_to_guides.rst b/docs/modules/memory/how_to_guides.rst index f0e359f7..3240aa76 100644 --- a/docs/modules/memory/how_to_guides.rst +++ b/docs/modules/memory/how_to_guides.rst @@ -15,6 +15,8 @@ The examples here all highlight how to use memory in different ways. `Adding Memory to Agents <./examples/agent_with_memory.html>`_: How to add a memory component to any agent. +`Conversation Agent <./examples/conversational_agent.html>`_: Example of a conversation agent, which combines memory with agents and a conversation focused prompt. + .. toctree:: :maxdepth: 1 diff --git a/docs/use_cases/chatbots.md b/docs/use_cases/chatbots.md index 1a277533..e2196b36 100644 --- a/docs/use_cases/chatbots.md +++ b/docs/use_cases/chatbots.md @@ -7,6 +7,7 @@ Most chat based applications rely on remembering what happened in previous inter The following resources exist: - [ChatGPT Clone](../modules/memory/examples/chatgpt_clone.ipynb): A notebook walking through how to recreate a ChatGPT-like experience with LangChain. - [Conversation Memory](../modules/memory/getting_started.ipynb): A notebook walking through how to use different types of conversational memory. +- [Conversation Agent](../modules/memory/examples/conversational_agent.ipynb): A notebook walking through how to create an agent optimized for conversation. Additional related resources include: diff --git a/langchain/llms/openai.py b/langchain/llms/openai.py index 7f1d360c..476d7dca 100644 --- a/langchain/llms/openai.py +++ b/langchain/llms/openai.py @@ -171,8 +171,8 @@ class BaseOpenAI(BaseLLM, BaseModel): Generation( text=choice["text"], generation_info=dict( - finish_reason=choice["finish_reason"], - logprobs=choice["logprobs"], + finish_reason=choice.get("finish_reason"), + logprobs=choice.get("logprobs"), ), ) for choice in sub_choices diff --git a/pyproject.toml b/pyproject.toml index f9746eeb..63e6b895 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "langchain" -version = "0.0.57" +version = "0.0.58" description = "Building applications with LLMs through composability" authors = [] license = "MIT"