[PR #3471] [MERGED] update python moonshot integration #3519

Closed
opened 2026-06-05 18:23:22 -04:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/docs/pull/3471
Author: @ArcadiaLin
Created: 4/7/2026
Status: Merged
Merged: 4/7/2026
Merged by: @mdrxy

Base: mainHead: feat/update-moonshot-integration


📝 Commits (6)

  • 9146f04 update python moonshot integration
  • a8144f1 docs: update Moonshot Python integration page
  • 4e82772 Merge branch 'main' into feat/update-moonshot-integration
  • ea5906d Merge branch 'main' into feat/update-moonshot-integration
  • 9e2d6af Merge branch 'main' into feat/update-moonshot-integration
  • 3f19e78 cr

📊 Changes

3 files changed (+298 additions, -19 deletions)

View changed files

📝 src/oss/python/integrations/chat/moonshot.mdx (+251 -19)
📝 src/oss/python/integrations/providers/all_providers.mdx (+8 -0)
src/oss/python/integrations/providers/moonshot.mdx (+39 -0)

📄 Description

Overview

This PR updates the existing Python integration documentation page for Moonshot chat models to reflect the current standalone langchain-moonshot package.

Moonshot’s API and integration patterns have changed significantly over time; while using it, I found the existing docs were based on an outdated integration and no longer aligned well with the current LangChain ecosystem, so I opened this PR to refresh the page around the standalone langchain-moonshot package and its current usage patterns.

The page has been rewritten from the old community-style MoonshotChat documentation to the current ChatMoonshot integration and aligned with the package README and implementation details in langchain-moonshot.

The updated documentation covers:

  • package installation and credentials
  • default international endpoint configuration, with China endpoint guidance
  • ChatMoonshot instantiation and invocation
  • Moonshot-specific features such as reasoning_content, thinking, prompt_cache_key, safety_identifier, and max_completion_tokens
  • tool calling, structured output, streaming, and multimodal image input
  • known behavior notes for kimi-k2.5

Type of change

Type: Update existing documentation

Related issues/PRs

Checklist

  • I have read the contributing guidelines, including the language policy
  • I have tested my changes locally using docs dev
  • All code examples have been tested and work correctly
  • I have used root relative paths for internal links
  • I have updated navigation in src/docs.json if needed

Additional notes

  • This PR only updates the existing page at src/oss/python/integrations/chat/moonshot.mdx; it does not add a new navigation entry.
  • The documentation is based on the current standalone package repository: https://github.com/ArcadiaLin/langchain-moonshot.
  • As validation evidence for the integration itself, the package repository includes LangChain standard test output in pytest_standard.txt with:
    • 46 passed, 10 skipped, 1 xfailed
  • The single xfailed case is expected and intentional. It is not due to general tool-calling support and not simply because forced tool_choice is unsupported.
  • The xfailed case is specifically for output_version="v1" streamed tool-calling behavior, where Moonshot may emit a natural-language preamble before tool-call chunks, so the final streamed content_blocks do not reliably preserve the parsed tool-call payload.
  • Forced tool_choice is separately declared as unsupported in the standard test capability flags (has_tool_choice = False), but that is not the direct reason for the single xfailed result.
  • No navigation update was needed because this PR updates an existing documentation page.
  • Code examples were adapted from the current langchain-moonshot README and implementation, and the package repository includes LangChain standard test results in pytest_standard.txt.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/docs/pull/3471 **Author:** [@ArcadiaLin](https://github.com/ArcadiaLin) **Created:** 4/7/2026 **Status:** ✅ Merged **Merged:** 4/7/2026 **Merged by:** [@mdrxy](https://github.com/mdrxy) **Base:** `main` ← **Head:** `feat/update-moonshot-integration` --- ### 📝 Commits (6) - [`9146f04`](https://github.com/langchain-ai/docs/commit/9146f045657836658dac33e0abe3a9028c74f3c3) update python moonshot integration - [`a8144f1`](https://github.com/langchain-ai/docs/commit/a8144f1186937fe38bde9a8c9994ac22d762c93d) docs: update Moonshot Python integration page - [`4e82772`](https://github.com/langchain-ai/docs/commit/4e827729be37ce55f667151c4080902834029966) Merge branch 'main' into feat/update-moonshot-integration - [`ea5906d`](https://github.com/langchain-ai/docs/commit/ea5906d37562ae86e0de1c713045285ffce4bd9a) Merge branch 'main' into feat/update-moonshot-integration - [`9e2d6af`](https://github.com/langchain-ai/docs/commit/9e2d6af938c61538ca155f5e9686830c56a37fd9) Merge branch 'main' into feat/update-moonshot-integration - [`3f19e78`](https://github.com/langchain-ai/docs/commit/3f19e78a0d65990531cc063f3bbcaabf7f923569) cr ### 📊 Changes **3 files changed** (+298 additions, -19 deletions) <details> <summary>View changed files</summary> 📝 `src/oss/python/integrations/chat/moonshot.mdx` (+251 -19) 📝 `src/oss/python/integrations/providers/all_providers.mdx` (+8 -0) ➕ `src/oss/python/integrations/providers/moonshot.mdx` (+39 -0) </details> ### 📄 Description ## Overview This PR updates the existing Python integration documentation page for Moonshot chat models to reflect the current standalone `langchain-moonshot` package. Moonshot’s API and integration patterns have changed significantly over time; while using it, I found the existing docs were based on an outdated integration and no longer aligned well with the current LangChain ecosystem, so I opened this PR to refresh the page around the standalone langchain-moonshot package and its current usage patterns. The page has been rewritten from the old community-style `MoonshotChat` documentation to the current `ChatMoonshot` integration and aligned with the package README and implementation details in `langchain-moonshot`. The updated documentation covers: - package installation and credentials - default international endpoint configuration, with China endpoint guidance - `ChatMoonshot` instantiation and invocation - Moonshot-specific features such as `reasoning_content`, `thinking`, `prompt_cache_key`, `safety_identifier`, and `max_completion_tokens` - tool calling, structured output, streaming, and multimodal image input - known behavior notes for `kimi-k2.5` ## Type of change **Type:** Update existing documentation ## Related issues/PRs - GitHub issue: - https://github.com/langchain-ai/langchain-community/issues/396 - Feature PR: N/A - Linear issue: N/A - Slack thread: N/A ## Checklist - [x] I have read the [contributing guidelines](README.md), including the [language policy](https://docs.langchain.com/oss/python/contributing/overview#language-policy) - [x] I have tested my changes locally using `docs dev` - [x] All code examples have been tested and work correctly - [x] I have used **root relative** paths for internal links - [ ] I have updated navigation in `src/docs.json` if needed ## Additional notes - This PR only updates the existing page at `src/oss/python/integrations/chat/moonshot.mdx`; it does not add a new navigation entry. - The documentation is based on the current standalone package repository: `https://github.com/ArcadiaLin/langchain-moonshot`. - As validation evidence for the integration itself, the package repository includes LangChain standard test output in `pytest_standard.txt` with: - `46 passed, 10 skipped, 1 xfailed` - The single `xfailed` case is expected and intentional. It is not due to general tool-calling support and not simply because forced `tool_choice` is unsupported. - The `xfailed` case is specifically for `output_version="v1"` streamed tool-calling behavior, where Moonshot may emit a natural-language preamble before tool-call chunks, so the final streamed `content_blocks` do not reliably preserve the parsed tool-call payload. - Forced `tool_choice` is separately declared as unsupported in the standard test capability flags (`has_tool_choice = False`), but that is not the direct reason for the single `xfailed` result. - No navigation update was needed because this PR updates an existing documentation page. - Code examples were adapted from the current `langchain-moonshot` README and implementation, and the package repository includes LangChain standard test results in `pytest_standard.txt`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-06-05 18:23:22 -04:00
yindo closed this issue 2026-06-05 18:23:22 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/docs#3519