Skip to content

0.4.1: align reference-doc surface with canonical public API#13

Closed
NormallyGaussian wants to merge 1 commit intomainfrom
0.4.1-doc-discoverability
Closed

0.4.1: align reference-doc surface with canonical public API#13
NormallyGaussian wants to merge 1 commit intomainfrom
0.4.1-doc-discoverability

Conversation

@NormallyGaussian
Copy link
Copy Markdown
Collaborator

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:

  • Per-class pages titled ChatParallelWeb / ParallelWebSearchTool, even though the user-facing integration docs at docs.langchain.com/oss/integrations/chat/parallel (and friends) promote ChatParallel / ParallelSearchTool as the canonical names.
  • Settings classes (ExcerptSettings, FetchPolicy, FullContentSettings, SourcePolicy) rendering at private paths like langchain-parallel/_types/SourcePolicy.
  • Internal _client.py helpers 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 _types module to drop the leading underscore.

What changed

Class-definition flip (back-compat preserved)

  • ChatParallel is now the actual class definition; ChatParallelWeb = ChatParallel is the back-compat alias.
  • ParallelSearchTool is now the actual class definition; ParallelWebSearchTool = ParallelSearchTool is the back-compat alias.
  • Both old and new names continue to import. isinstance(x, ChatParallelWeb) continues to work — they're the same class object.
>>> from langchain_parallel import ChatParallel, ChatParallelWeb
>>> ChatParallel is ChatParallelWeb
True
>>> ChatParallel.__name__
'ChatParallel'      # was 'ChatParallelWeb' before — this is what reference docs will pick up

_typestypes rename

  • langchain_parallel/_types.pylangchain_parallel/types.py (the public settings classes now live at the public module path).
  • A 1-file _types.py shim re-exports everything from types, so any code that imported from langchain_parallel._types keeps working.

_client.py marked private

  • Adds __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

  • All 87 unit tests pass; 2 xfail unchanged.
  • ruff check clean; ruff format --check clean; mypy clean.
  • Public API surface verified by import + identity check (ChatParallel is ChatParallelWeb etc.).

What this doesn't fix

The "Modules" section on the reference page is scraped from providers/parallel.mdx in 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.

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.
@NormallyGaussian
Copy link
Copy Markdown
Collaborator Author

Closing for now — abandoning until we have a clearer call on the right approach for hiding the internal _client.py helpers from reference docs (the open question being whether __all__: list[str] = [] is enough, or whether we need a more invasive change). The branch 0.4.1-doc-discoverability stays available if/when we revisit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant