-
Notifications
You must be signed in to change notification settings - Fork 15.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Standardize ChatModel docstrings and integration docs #22296
Comments
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 ? |
Related to #22296 And update anthropic to accept base_url
Part of #22296. Part two of langchain-ai/langchain-google#287
**Updated ChatHuggingFace doc string as per issue #22296**: "langchain_huggingface: updated docstring for ChatHuggingFace in langchain_huggingface to match that of the description (in the appendix) provided in issue #22296. " **Issue:** This PR is in response to issue #22296, and more specifically ChatHuggingFace model. In particular, this PR updates the docstring for langchain/libs/partners/hugging_face/langchain_huggingface/chat_models/huggingface.py by adding the following sections: Instantiate, Invoke, Stream, Async, Tool calling, and Response metadata. I used the template from the Anthropic implementation and referenced the Appendix of the original issue post. I also noted that: langchain_community hugging face llms do not work with langchain_huggingface's ChatHuggingFace model (at least for me); the .stream(messages) functionality of ChatHuggingFace only returned a block of response. --------- Co-authored-by: lucast2021 <lucast2021@headroyce.org> Co-authored-by: Bagatur <baskaryan@gmail.com>
Updated ChatGroq doc string as per issue https://github.com/langchain-ai/langchain/issues/22296:"langchain_groq: updated docstring for ChatGroq in langchain_groq to match that of the description (in the appendix) provided in issue #22296. " Issue: This PR is in response to issue #22296, and more specifically the ChatGroq model. In particular, this PR updates the docstring for langchain/libs/partners/groq/langchain_groq/chat_model.py by adding the following sections: Instantiate, Invoke, Stream, Async, Tool calling, Structured Output, and Response metadata. I used the template from the Anthropic implementation and referenced the Appendix of the original issue post. I also noted that: `usage_metadata `returns none for all ChatGroq models I tested; there is no mention of image input in the ChatGroq documentation; unlike that of ChatHuggingFace, `.stream(messages)` for ChatGroq returned blocks of output. --------- Co-authored-by: lucast2021 <lucast2021@headroyce.org> Co-authored-by: Bagatur <baskaryan@gmail.com>
- **Description:** Update ZhipuAI ChatModel rich docstring - **Issue:** the issue #22296
Related to #22296 And update anthropic to accept base_url
Part of #22296. Part two of langchain-ai/langchain-google#287
**Updated ChatHuggingFace doc string as per issue #22296**: "langchain_huggingface: updated docstring for ChatHuggingFace in langchain_huggingface to match that of the description (in the appendix) provided in issue #22296. " **Issue:** This PR is in response to issue #22296, and more specifically ChatHuggingFace model. In particular, this PR updates the docstring for langchain/libs/partners/hugging_face/langchain_huggingface/chat_models/huggingface.py by adding the following sections: Instantiate, Invoke, Stream, Async, Tool calling, and Response metadata. I used the template from the Anthropic implementation and referenced the Appendix of the original issue post. I also noted that: langchain_community hugging face llms do not work with langchain_huggingface's ChatHuggingFace model (at least for me); the .stream(messages) functionality of ChatHuggingFace only returned a block of response. --------- Co-authored-by: lucast2021 <lucast2021@headroyce.org> Co-authored-by: Bagatur <baskaryan@gmail.com>
Updated ChatGroq doc string as per issue https://github.com/langchain-ai/langchain/issues/22296:"langchain_groq: updated docstring for ChatGroq in langchain_groq to match that of the description (in the appendix) provided in issue #22296. " Issue: This PR is in response to issue #22296, and more specifically the ChatGroq model. In particular, this PR updates the docstring for langchain/libs/partners/groq/langchain_groq/chat_model.py by adding the following sections: Instantiate, Invoke, Stream, Async, Tool calling, Structured Output, and Response metadata. I used the template from the Anthropic implementation and referenced the Appendix of the original issue post. I also noted that: `usage_metadata `returns none for all ChatGroq models I tested; there is no mention of image input in the ChatGroq documentation; unlike that of ChatHuggingFace, `.stream(messages)` for ChatGroq returned blocks of output. --------- Co-authored-by: lucast2021 <lucast2021@headroyce.org> Co-authored-by: Bagatur <baskaryan@gmail.com>
- **Description:** Update ZhipuAI ChatModel rich docstring - **Issue:** the issue #22296
- **Description:** Update QianfanChatEndpoint ChatModel rich docstring - **Issue:** the issue #22296
) - **Description:** Update QianfanChatEndpoint ChatModel rich docstring - **Issue:** the issue langchain-ai#22296
) - **Description:** Update QianfanChatEndpoint ChatModel rich docstring - **Issue:** the issue langchain-ai#22296
- **Description:** Add MiniMaxChat rich docstrings. - **Issue:** the issue #22296
- **Description:** Add ChatBaichuan rich docstrings. - **Issue:** the issue #22296
- **Description:** - Add `ChatSparkLLM` docstrings, the issue #22296 - To support `stream` method
Part of #22296 --------- Co-authored-by: isaac hershenson <ihershenson@hmc.edu>
part of #22296 --------- Co-authored-by: isaac hershenson <ihershenson@hmc.edu>
- **Description:** - Add `ChatSparkLLM` docstrings, the issue langchain-ai#22296 - To support `stream` method
Part of langchain-ai#22296 --------- Co-authored-by: isaac hershenson <ihershenson@hmc.edu>
part of langchain-ai#22296 --------- Co-authored-by: isaac hershenson <ihershenson@hmc.edu>
Hi, @baskaryan, I'm Dosu, and I'm helping the LangChain team manage their backlog. I'm marking this issue as stale. The issue you opened focuses on standardizing the docstrings and integration documentation for ChatModel integrations to enhance clarity and usability. There has been interest from contributors like @chaityacshah and @anilkumarKanasani, who are eager to collaborate on this task, but it seems there hasn't been any recent progress. Could you please let me know if this issue is still relevant to the latest version of the LangChain repository? If it is, kindly comment on the issue to keep it active. Otherwise, feel free to close it yourself, or it will be automatically closed in 7 days. Thank you! |
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):
make api_docs_clean; make api_docs_quick_preview API_PKG=openai
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):poetry run pip install -e libs/cli poetry run langchain-cli integration create-doc --name "foo-bar" --name-class FooBar --destination-dir ./docs/docs/integrations/chat/
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):
make docs_clean make docs_build cd docs/build/output-new yarn yarn start
Appendix
Expected sections for the ChatModel class docstring.
The text was updated successfully, but these errors were encountered: