0.4.1: align reference-doc surface with canonical public API#13
Closed
NormallyGaussian wants to merge 1 commit intomainfrom
Closed
0.4.1: align reference-doc surface with canonical public API#13NormallyGaussian wants to merge 1 commit intomainfrom
NormallyGaussian wants to merge 1 commit intomainfrom
Conversation
Documentation discoverability fixes only — no API changes for end users. The reference docs at reference.langchain.com/python/langchain-parallel were rendering pages under legacy class names (`ChatParallelWeb`, `ParallelWebSearchTool`) and at private module paths (`_types`, `_client`). The user-facing integration docs already promote the canonical names (`ChatParallel`, `ParallelSearchTool`), so the two sources drifted. This release reorganizes the source so the auto-generated reference picks up the canonical names. Changes: - `ChatParallel` is now the actual class definition; `ChatParallelWeb` is the back-compat alias (`ChatParallelWeb = ChatParallel`). Same flip for `ParallelSearchTool` / `ParallelWebSearchTool`. Both names continue to import and `isinstance(x, ChatParallelWeb)` continues to work — they remain the same class object. - `langchain_parallel._types` → `langchain_parallel.types`. The settings classes (`ExcerptSettings`, `FetchPolicy`, `FullContentSettings`, `SourcePolicy`) now live at a public module path. `_types` remains as a back-compat re-export shim. - `langchain_parallel._client` declares `__all__: list[str] = []` and a "private module" docstring so doc tooling treats it as internal. All 87 unit tests pass. ruff + mypy clean.
Collaborator
Author
|
Closing for now — abandoning until we have a clearer call on the right approach for hiding the internal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The reference docs at
reference.langchain.com/python/langchain-parallel(auto-generated by langchain-ai) were rendering pages under the legacy class names and at private module paths:ChatParallelWeb/ParallelWebSearchTool, even though the user-facing integration docs atdocs.langchain.com/oss/integrations/chat/parallel(and friends) promoteChatParallel/ParallelSearchToolas the canonical names.ExcerptSettings,FetchPolicy,FullContentSettings,SourcePolicy) rendering at private paths likelangchain-parallel/_types/SourcePolicy._client.pyhelpers showing up in the package's "Functions" list.This is purely a doc-discoverability problem — no end-user code change is required. The fix is to flip the source-side relationship so the canonical names are the actual class definitions and the legacy names are the aliases, plus rename the
_typesmodule to drop the leading underscore.What changed
Class-definition flip (back-compat preserved)
ChatParallelis now the actualclassdefinition;ChatParallelWeb = ChatParallelis the back-compat alias.ParallelSearchToolis now the actualclassdefinition;ParallelWebSearchTool = ParallelSearchToolis the back-compat alias.isinstance(x, ChatParallelWeb)continues to work — they're the same class object._types→typesrenamelangchain_parallel/_types.py→langchain_parallel/types.py(the public settings classes now live at the public module path)._types.pyshim re-exports everything fromtypes, so any code that imported fromlangchain_parallel._typeskeeps working._client.pymarked private__all__: list[str] = []and an explicit "private module" docstring so reference-doc tooling treats it as internal. The functions inside (get_api_key,get_parallel_client, etc.) were never exported from the package root and remain implementation detail.Migration
No code changes required. All four call sites continue to work:
from langchain_parallel import ChatParallelWeb✅from langchain_parallel import ChatParallel✅from langchain_parallel import ParallelWebSearchTool✅from langchain_parallel import ParallelSearchTool✅from langchain_parallel._types import ExcerptSettings✅ (via shim)from langchain_parallel.types import ExcerptSettings✅ (preferred)from langchain_parallel import ExcerptSettings✅ (preferred)Verification
ruff checkclean;ruff format --checkclean;mypyclean.ChatParallel is ChatParallelWebetc.).What this doesn't fix
The "Modules" section on the reference page is scraped from
providers/parallel.mdxin the langchain-ai/docs repo, not from the package source. That section will refresh on its own once reference.langchain.com rebuilds against langchain-ai/docs#3787 (already merged). No package-side change needed for that one.AI agent disclosure
Authored with substantial assistance from Claude. All changes were verified against the package source, executed via the unit test suite, and confirmed to preserve the public API via direct import checks.