Skip to content

Conversation

@cbornet
Copy link
Collaborator

@cbornet cbornet commented Dec 5, 2025

With this we get the correct types for _runnable_support annotated functions.

  • return list[BaseMessage] when messages is not None
  • return Runnable when messages is None
  • typing of function args

@cbornet cbornet requested a review from eyurtsev as a code owner December 5, 2025 17:49
@github-actions github-actions bot added core Related to the package `langchain-core` infra Chores, devops, repo meta changes labels Dec 5, 2025

# test explicitly excluding all tool calls
actual = filter_messages(messages, exclude_tool_calls={"1", "2"})
actual = filter_messages(messages, exclude_tool_calls=["1", "2"])
Copy link
Collaborator Author

@cbornet cbornet Dec 5, 2025

Choose a reason for hiding this comment

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

It found some incorrect typing 😃

@github-actions github-actions bot added infra Chores, devops, repo meta changes and removed infra Chores, devops, repo meta changes labels Dec 5, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Dec 5, 2025

CodSpeed Performance Report

Merging #34225 will not alter performance

Comparing cbornet:messages-utils-types (6b95a89) with master (80c3970)

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

Summary

✅ 13 untouched
⏩ 21 skipped1

Footnotes

  1. 21 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@github-actions github-actions bot added infra Chores, devops, repo meta changes and removed infra Chores, devops, repo meta changes labels Dec 5, 2025
@cbornet cbornet force-pushed the messages-utils-types branch from d06f642 to 8740ee2 Compare December 6, 2025 16:33
@github-actions github-actions bot added infra Chores, devops, repo meta changes and removed infra Chores, devops, repo meta changes labels Dec 6, 2025

def test_trim_messages_bad_token_counter() -> None:
trimmer = trim_messages(max_tokens=10, token_counter={})
trimmer = trim_messages(max_tokens=10, token_counter={}) # type: ignore[call-overload]
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There is now typing for _runnable_support annotated method args.

@cbornet cbornet force-pushed the messages-utils-types branch from 8740ee2 to c35c6b7 Compare December 6, 2025 16:42
@cbornet cbornet force-pushed the messages-utils-types branch from c35c6b7 to cb51436 Compare December 6, 2025 16:49
@github-actions github-actions bot added langchain Related to the package `langchain` infra Chores, devops, repo meta changes and removed infra Chores, devops, repo meta changes labels Dec 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Related to the package `langchain-core` infra Chores, devops, repo meta changes langchain Related to the package `langchain`

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant