From b7f34749b16d02ab5f90f6e7bcb6f7f6fade0c4f Mon Sep 17 00:00:00 2001 From: Michael Li Date: Fri, 30 May 2025 05:55:36 +1000 Subject: [PATCH 1/3] docs: fix grammar issue in assign.ipynb and fireworks.ipynb (#31412) Co-authored-by: ccurme --- docs/docs/how_to/assign.ipynb | 2 +- docs/docs/integrations/chat/fireworks.ipynb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/docs/how_to/assign.ipynb b/docs/docs/how_to/assign.ipynb index b231b0fb781..94efd41e532 100644 --- a/docs/docs/how_to/assign.ipynb +++ b/docs/docs/how_to/assign.ipynb @@ -157,7 +157,7 @@ "\n", "## Next steps\n", "\n", - "Now you've learned how to pass data through your chains to help to help format the data flowing through your chains.\n", + "Now you've learned how to pass data through your chains to help format the data flowing through your chains.\n", "\n", "To learn more, see the other how-to guides on runnables in this section." ] diff --git a/docs/docs/integrations/chat/fireworks.ipynb b/docs/docs/integrations/chat/fireworks.ipynb index d3ddfccd1e3..1924151910a 100644 --- a/docs/docs/integrations/chat/fireworks.ipynb +++ b/docs/docs/integrations/chat/fireworks.ipynb @@ -17,7 +17,7 @@ "source": [ "# ChatFireworks\n", "\n", - "This doc help you get started with Fireworks AI [chat models](/docs/concepts/chat_models). For detailed documentation of all ChatFireworks features and configurations head to the [API reference](https://python.langchain.com/api_reference/fireworks/chat_models/langchain_fireworks.chat_models.ChatFireworks.html).\n", + "This doc helps you get started with Fireworks AI [chat models](/docs/concepts/chat_models). For detailed documentation of all ChatFireworks features and configurations head to the [API reference](https://python.langchain.com/api_reference/fireworks/chat_models/langchain_fireworks.chat_models.ChatFireworks.html).\n", "\n", "Fireworks AI is an AI inference platform to run and customize models. For a list of all models served by Fireworks see the [Fireworks docs](https://fireworks.ai/models).\n", "\n", @@ -39,7 +39,7 @@ "\n", "### Credentials\n", "\n", - "Head to (ttps://fireworks.ai/login to sign up to Fireworks and generate an API key. Once you've done this set the FIREWORKS_API_KEY environment variable:" + "Head to (https://fireworks.ai/login to sign up to Fireworks and generate an API key. Once you've done this set the FIREWORKS_API_KEY environment variable:" ] }, { From 729526ff7c9dd3ff5ca1a223bc4404c3c97a7031 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=85=E0=A4=82kur=20=E0=A4=97=E0=A5=8Bswami?= Date: Fri, 30 May 2025 01:29:35 +0530 Subject: [PATCH 2/3] huggingface: Undefined model_id fix (#31358) **Description:** This change fixes the undefined model_id issue when instantiating [ChatHuggingFace](https://github.com/langchain-ai/langchain/blob/master/libs/partners/huggingface/langchain_huggingface/chat_models/huggingface.py#L306) **Issue:** Fixes https://github.com/langchain-ai/langchain/issues/31357 @baskaryan @hwchase17 --- .../langchain_huggingface/chat_models/huggingface.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/partners/huggingface/langchain_huggingface/chat_models/huggingface.py b/libs/partners/huggingface/langchain_huggingface/chat_models/huggingface.py index df63c1f3ddb..cceed0e1e5a 100644 --- a/libs/partners/huggingface/langchain_huggingface/chat_models/huggingface.py +++ b/libs/partners/huggingface/langchain_huggingface/chat_models/huggingface.py @@ -775,12 +775,12 @@ class ChatHuggingFace(BaseChatModel): elif _is_huggingface_pipeline(self.llm): from transformers import AutoTokenizer # type: ignore[import] + self.model_id = self.model_id or self.llm.model_id self.tokenizer = ( AutoTokenizer.from_pretrained(self.model_id) if self.tokenizer is None else self.tokenizer ) - self.model_id = self.llm.model_id return elif _is_huggingface_endpoint(self.llm): self.model_id = self.llm.repo_id or self.llm.model From d79b5813a0b3b243c612b77013768995e46c4337 Mon Sep 17 00:00:00 2001 From: Michael Li Date: Fri, 30 May 2025 06:03:17 +1000 Subject: [PATCH 3/3] doc: fix grammar in writer.ipynb (#31400) Thank you for contributing to LangChain! - [x] **PR title**: "package: description" - Where "package" is whichever of langchain, core, etc. is being modified. Use "docs: ..." for purely docs changes, "infra: ..." for CI changes. - Example: "core: add foobar LLM" - [x] **PR message**: ***Delete this entire checklist*** and replace with - **Description:** a description of the change - **Issue:** the issue # it fixes, if applicable - **Dependencies:** any dependencies required for this change - **Twitter handle:** if your PR gets announced, and you'd like a mention, we'll gladly shout you out! - [x] **Add tests and docs**: If you're adding a new integration, please include 1. a test for the integration, preferably unit tests that do not rely on network access, 2. an example notebook showing its use. It lives in `docs/docs/integrations` directory. - [x] **Lint and test**: Run `make format`, `make lint` and `make test` from the root of the package(s) you've modified. See contribution guidelines for more: https://python.langchain.com/docs/contributing/ Additional guidelines: - Make sure optional dependencies are imported within a function. - Please do not add dependencies to pyproject.toml files (even optional ones) unless they are required for unit tests. - Most PRs should not touch more than one package. - Changes should be backwards compatible. If no one reviews your PR within a few days, please @-mention one of baskaryan, eyurtsev, ccurme, vbarda, hwchase17. Co-authored-by: ccurme --- docs/docs/integrations/chat/writer.ipynb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/docs/integrations/chat/writer.ipynb b/docs/docs/integrations/chat/writer.ipynb index bb71be8eb86..bb43b4b332a 100644 --- a/docs/docs/integrations/chat/writer.ipynb +++ b/docs/docs/integrations/chat/writer.ipynb @@ -303,7 +303,7 @@ "source": [ "### A note on tool binding\n", "\n", - "The `ChatWriter.bind_tools()` method does not create new instance with bound tools, but stores the received `tools` and `tool_choice` in the initial class instance attributes to pass them as parameters during the Palmyra LLM call while using `ChatWriter` invocation. This approach allows the support of different tool types, e.g. `function` and `graph`. `Graph` is one of the remotely called Writer Palmyra tools. For further information visit our [docs](https://dev.writer.com/api-guides/knowledge-graph#knowledge-graph). \n", + "The `ChatWriter.bind_tools()` method does not create a new instance with bound tools, but stores the received `tools` and `tool_choice` in the initial class instance attributes to pass them as parameters during the Palmyra LLM call while using `ChatWriter` invocation. This approach allows the support of different tool types, e.g. `function` and `graph`. `Graph` is one of the remotely called Writer Palmyra tools. For further information, visit our [docs](https://dev.writer.com/api-guides/knowledge-graph#knowledge-graph). \n", "\n", "For more information about tool usage in LangChain, visit the [LangChain tool calling documentation](https://python.langchain.com/docs/concepts/tool_calling/)." ] @@ -373,7 +373,7 @@ "source": [ "## Prompt templates\n", "\n", - "[Prompt templates](https://python.langchain.com/docs/concepts/prompt_templates/) help to translate user input and parameters into instructions for a language model. You can use `ChatWriter` with a prompt templates like so:\n" + "[Prompt templates](https://python.langchain.com/docs/concepts/prompt_templates/) help to translate user input and parameters into instructions for a language model. You can use `ChatWriter` with a prompt template like so:\n" ] }, { @@ -411,7 +411,7 @@ "metadata": {}, "source": [ "## API reference\n", - "For detailed documentation of all ChatWriter features and configurations head to the [API reference](https://python.langchain.com/api_reference/writer/chat_models/langchain_writer.chat_models.ChatWriter.html#langchain_writer.chat_models.ChatWriter).\n", + "For detailed documentation of all ChatWriter features and configurations, head to the [API reference](https://python.langchain.com/api_reference/writer/chat_models/langchain_writer.chat_models.ChatWriter.html#langchain_writer.chat_models.ChatWriter).\n", "\n", "## Additional resources\n", "You can find information about Writer's models (including costs, context windows, and supported input types) and tools in the [Writer docs](https://dev.writer.com/home)."