Skip to content

Conversation

christian-bromann
Copy link
Member

@Copilot Copilot AI review requested due to automatic review settings October 6, 2025 11:24
@github-actions github-actions bot added langchain For docs changes to LangChain oss labels Oct 6, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR documents the new retry_model_request hook functionality for LangChain middleware, which allows middleware to handle model execution failures and implement retry logic with modified parameters.

Key changes:

  • Documents the new retry_model_request/retryModelRequest hook for both Python and JavaScript
  • Adds comprehensive documentation for the new ModelFallbackMiddleware that uses this hook
  • Updates middleware execution order documentation to include retry behavior

Copy link

github-actions bot commented Oct 6, 2025

Preview ID generated: preview-cbretr-1759749913-4c2b387

Copy link
Collaborator

@lnhsingh lnhsingh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some nits but otherwise looks good

Co-authored-by: Lauren Hirata Singh <[email protected]>
@Copilot Copilot AI review requested due to automatic review settings October 7, 2025 08:28
Co-authored-by: Lauren Hirata Singh <[email protected]>
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Copy link

github-actions bot commented Oct 7, 2025

Preview ID generated: preview-cbretr-1759825760-5ab4575

Copy link

github-actions bot commented Oct 7, 2025

Preview ID generated: preview-cbretr-1759826112-955d806

@Copilot Copilot AI review requested due to automatic review settings October 7, 2025 08:37
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

```python
from langchain.agents import create_agent
from langchain.agents.middleware import AgentState, ModelRequest, modify_model_request
from langchain.agents.middleware.types import AgentState, ModelRequest, modify_model_request
Copy link
Preview

Copilot AI Oct 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The import path has been changed from langchain.agents.middleware to langchain.agents.middleware.types. This appears to be a breaking change that should be highlighted in the documentation or migration guide, as existing code using the old import path will fail.

Copilot uses AI. Check for mistakes.

Copy link

github-actions bot commented Oct 7, 2025

Preview ID generated: preview-cbretr-1759826292-33b6b4e

@eyurtsev
Copy link
Collaborator

eyurtsev commented Oct 7, 2025

Standby as we might be changing this hook to on_model_call

@eyurtsev
Copy link
Collaborator

eyurtsev commented Oct 7, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
langchain For docs changes to LangChain oss
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants