Open baskaryan opened 1 month ago
hi @baskaryan, i'm interested in this. where would I find more info for the fields in Doc pages that aren't autopopulated?
Hi @chaityacshah, I am interested to contribute to this issue. I am doing open source contribution for the first time. Can we both together take up this task ?
Issue
To make our chat model 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 chat model docstrings and updating the actual integration docs.
This needs to be done for each ChatModel integration, ideally with one PR per ChatModel.
Related to broader issues #21983 and #22005.
Docstrings
Each ChatModel class docstring should have the sections shown in the Appendix below. The sections should have input and output code blocks when relevant. See ChatOpenAI docstrings and corresponding API reference for an example.
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 ChatModel docs page should follow this template. See ChatOpenAI for an example.
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 "Chat" prefix. This will create a template doc with some autopopulated fields at docs/docs/integrations/chat/foo_bar.ipynb.To build a preview of the docs you can run (from root):
Appendix
Expected sections for the ChatModel class docstring.