Skip to content

Conversation

@cbornet
Copy link
Collaborator

@cbornet cbornet commented Jan 2, 2026

  • Fix typing of async functions for @wrap_model_call and @wrap_tool_call
  • Use type aliases instead of protocols. This is better regarding open/close principle: this way the user can use any names for the function parameters, only the position is important.
  • Remove useless generics
  • Use cast when mypy can't narrow the type (iscoroutinefunction doesn't narrow the callables, and the types in the unions are too complex for a TypeGuard to work)

related: #34583 #34249

@github-actions github-actions bot added langchain `langchain` package issues & PRs infra PRs made that include chores, devops, repo meta changes and removed infra PRs made that include chores, devops, repo meta changes labels Jan 2, 2026
@cbornet cbornet requested a review from sydney-runkle January 2, 2026 13:45
@github-actions github-actions bot added infra PRs made that include chores, devops, repo meta changes and removed infra PRs made that include chores, devops, repo meta changes labels Jan 2, 2026
@cbornet cbornet force-pushed the agent-decorator-types branch from 4fc7baf to cf84d56 Compare January 3, 2026 11:39
@github-actions github-actions bot added infra PRs made that include chores, devops, repo meta changes and removed infra PRs made that include chores, devops, repo meta changes labels Jan 3, 2026
@mdrxy mdrxy added the typing label Jan 4, 2026
@cbornet cbornet force-pushed the agent-decorator-types branch from cf84d56 to 8e95399 Compare January 10, 2026 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infra PRs made that include chores, devops, repo meta changes langchain `langchain` package issues & PRs typing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants