Skip to content

Commit b7cdd4e

Browse files
Clarify TypeDirectedDocumentLoader example use case
1 parent 5dcc974 commit b7cdd4e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎docs/reference/document-loaders/type-directed.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ hide: [toc]
1212

1313
`TypeDirectedDocumentLoader` dispatches a value to the loader registered for its Python type. Applications can register any types that represent distinct document locations or loading policies.
1414

15-
This example registers `Path` for local documents and `str` for URL values. A local document is loaded through `FileDocumentLoader`; its remote `@context` is a URL string, so the `str` registration delegates to a nested `SchemeDirectedDocumentLoader`.
15+
## Example use case
16+
17+
One use case for `TypeDirectedDocumentLoader` is an application that accepts local `pathlib.Path` values and remote URL strings in the same JSON-LD workflow. This example routes paths through `FileDocumentLoader`; when a local document references a remote `@context`, its `str` URL is delegated to `SchemeDirectedDocumentLoader`.
1618

1719
=== "Example"
1820

0 commit comments

Comments
 (0)