Skip to content

prebuilt==0.1.8

Choose a tag to compare

@github-actions github-actions released this 03 Apr 16:04
e89633f

langgraph-prebuilt 0.1.8

Summary of Changes

  • Added support for pre-model hooks in agent executors to handle long message histories through trimming or summarization (PR #4059)

Detailed Changes

langgraph.prebuilt.chat_agent_executor.create_react_agent

  • Added new pre_model_hook parameter which lets you insert a custom node before LLM calls (PR #4059)
  • The pre-model hook can modify message history or provide alternate messages for the LLM without affecting the state
  • Useful for managing long conversations through message trimming, summarization, or other preprocessing
  • Hook can return either messages (which updates state) or llm_input_messages (which only affects the LLM input)
  • Extended graph structure to properly handle the hook in the control flow