-
Notifications
You must be signed in to change notification settings - Fork 20.3k
chore(core): fix some any generics #34545
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
CodSpeed Performance ReportMerging #34545 will improve performance by 26.72%Comparing
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ⚡ | WallTime | test_import_time[tool] |
666.8 ms | 526.2 ms | +26.72% |
| ⚡ | WallTime | test_import_time[Document] |
217.7 ms | 189 ms | +15.16% |
| ⚡ | WallTime | test_import_time[InMemoryVectorStore] |
790.7 ms | 630.6 ms | +25.39% |
| ⚡ | WallTime | test_import_time[CallbackManager] |
588.6 ms | 473.5 ms | +24.29% |
| ⚡ | WallTime | test_import_time[RunnableLambda] |
625.8 ms | 513.9 ms | +21.79% |
| ⚡ | WallTime | test_import_time[BaseChatModel] |
661.8 ms | 536.6 ms | +23.34% |
| ⚡ | WallTime | test_import_time[HumanMessage] |
312.3 ms | 263.8 ms | +18.39% |
| ⚡ | WallTime | test_import_time[Runnable] |
636.1 ms | 503.3 ms | +26.4% |
| ⚡ | WallTime | test_import_time[ChatPromptTemplate] |
741.8 ms | 607.9 ms | +22.04% |
| ⚡ | WallTime | test_import_time[LangChainTracer] |
563.9 ms | 461.4 ms | +22.22% |
Footnotes
-
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. ↩
ce083cc to
67cf257
Compare
609f765 to
f1338b5
Compare
| cls: type[Self], | ||
| template: str | ||
| | list[str | _TextTemplateParam | _ImageTemplateParam | dict[str, Any]], | ||
| | Sequence[str | _TextTemplateParam | _ImageTemplateParam | dict[str, Any]], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to invariant Sequence to allow passing list[dict[str, Any]]
| async for chunk in map_output: | ||
| yield chunk | ||
| first_chunk = await first_map_chunk_task | ||
| if first_chunk is not None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typing revealed an issue: if map_output is exhausted, we shouldn't yield None
| return None | ||
|
|
||
|
|
||
| def _get_filtered_args( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private and not used anymore
| for depth, value in self.current_header_stack: | ||
| header_key = self.splittable_headers.get("#" * depth) | ||
| self.current_chunk.metadata[header_key] = value | ||
| if header_key is not None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typing revealed an issue: if self.splittable_headers doesn't have the "#" * depth key, we shouldn't add a None key to chunk metadata.
f1338b5 to
405f1e4
Compare
No description provided.