Open efriis opened 2 months ago
running
poetry run langchain-cli integration create-doc --name "community" --name-class Ollama --component-type Embeddings --destination-dir ./docs/docs/integrations/text_embedding/
results in
ValueError: Unrecognized component_type='Embeddings'. Expected one of 'ChatModel', 'DocumentLoader', 'Tool'.
am I missing anything?
Try updating your cli with
poetry run pip install -U langchain-cli
Privileged issue
Issue Content
Issue
To make our Embeddings integrations as easy to use as possible we need to make sure the docs for them are thorough and standardized. There are two parts to this: updating the embeddings docstrings and updating the actual integration docs.
This needs to be done for each embeddings integration, ideally with one PR per embedding provider.
Related to broader issues #21983 and #22005.
Docstrings
Each Embeddings class docstring should have the sections shown in the Appendix below. The sections should have input and output code blocks when relevant.
To build a preview of the API docs for the package you're working on run (from root of repo):
where
API_PKG=
should be the parent directory that houses the edited package (e.g. community, openai, anthropic, huggingface, together, mistralai, groq, fireworks, etc.). This should be quite fast for all the partner packages.Doc pages
Each Embeddings docs page should follow this template.
You can use the
langchain-cli
to quickly get started with a new chat model integration docs page (run from root of repo):where
--name
is the integration package name without the "langchain-" prefix and--name-class
is the class name without the "Embedding" prefix. This will create a template doc with some autopopulated fields at docs/docs/integrations/text_embedding/foo_bar.ipynb.To build a preview of the docs you can run (from root):
Appendix
Expected sections for the Embedding class docstring.
__package_name___
: This is the full name of the package (e.g.,langchain-anthropic
)__ModuleName__
: This is the CamelCase name of the partner (e.g.,Anthropic
)__MODULE_NAME__
: SCREAMING_SNAKE_CASE name of the partner (e.g., ANTHROPIC)Y
Tip: if you copy and paste the template to a template.txt file, you could use the following sed commands to fill in the appropriate values for OpenAI: