docs: standardize azure openai page (#23642)

part of #22296
This commit is contained in:
Bagatur
2024-06-28 15:15:41 -07:00
committed by GitHub
parent e8d77002ea
commit 381aedcc61
7 changed files with 230 additions and 91 deletions

View File

@@ -19,7 +19,7 @@
"\n",
"- TODO: Make sure API reference link is correct.\n",
"\n",
"This notebook provides a quick overview for getting started with __ModuleName__ [chat models](/docs/concepts/#chat-models). For detailed documentation of all Chat__ModuleName__ features and configurations head to the [API reference](https://api.python.langchain.com/en/latest/chat_models/__module_name__.chat_models.Chat__ModuleName__.html).\n",
"This will help you getting started with __ModuleName__ [chat models](/docs/concepts/#chat-models). For detailed documentation of all Chat__ModuleName__ features and configurations head to the [API reference](https://api.python.langchain.com/en/latest/chat_models/__module_name__.chat_models.Chat__ModuleName__.html).\n",
"\n",
"- TODO: Add any other relevant links, like information about models, prices, context windows, etc. See https://python.langchain.com/v0.2/docs/integrations/chat/openai/ for an example.\n",
"\n",
@@ -253,7 +253,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.1"
"version": "3.11.9"
}
},
"nbformat": 4,

View File

@@ -11,7 +11,7 @@ class __ModuleName__Loader(BaseLoader):
# https://github.com/langchain-ai/langchain/blob/869523ad728e6b76d77f170cce13925b4ebc3c1e/libs/community/langchain_community/document_loaders/recursive_url_loader.py#L54
"""
__ModuleName__ document loader integration
# TODO: Replace with relevant packages, env vars.
Setup:
Install ``__package_name__`` and set environment variable ``__MODULE_NAME___API_KEY``.
@@ -48,7 +48,7 @@ class __ModuleName__Loader(BaseLoader):
.. code-block:: python
TODO: Example output
TODO: Example output
# TODO: Delete if async load is not implemented
Async load:
@@ -67,6 +67,6 @@ class __ModuleName__Loader(BaseLoader):
# Do not implement load(), a default implementation is already available.
def lazy_load(self) -> Iterator[Document]:
raise NotImplementedError()
# TODO: Implement if you would like to change default BaseLoader implementation
# async def alazy_load(self) -> AsyncIterator[Document]:
# async def alazy_load(self) -> AsyncIterator[Document]:

View File

@@ -153,7 +153,9 @@ def create_doc(
component_type: Annotated[
str,
typer.Option(
help=("The type of component. Currently only 'ChatModel', 'DocumentLoader' supported."),
help=(
"The type of component. Currently only 'ChatModel', 'DocumentLoader' supported."
),
),
] = "ChatModel",
destination_dir: Annotated[
@@ -197,9 +199,14 @@ def create_doc(
# copy over template from ../integration_template
if component_type == "ChatModel":
docs_template = Path(__file__).parents[1] / "integration_template/docs/chat.ipynb"
docs_template = (
Path(__file__).parents[1] / "integration_template/docs/chat.ipynb"
)
elif component_type == "DocumentLoader":
docs_template = Path(__file__).parents[1] / "integration_template/docs/document_loaders.ipynb"
docs_template = (
Path(__file__).parents[1]
/ "integration_template/docs/document_loaders.ipynb"
)
shutil.copy(docs_template, destination_path)
# replacements in file