This repository was archived by the owner on Dec 11, 2025. It is now read-only.
feat: add support for Moonshot AI's Kimi K2 Thinking model#111
Merged
Conversation
- Introduced MOONSHOT_API_KEY in settings.py for API integration. - Updated providers.py to include KIMI_K2_THINKING model under Moonshot AI. - Enhanced client.py to handle requests for the Moonshot AI provider. - Added comprehensive tests for Kimi K2 Thinking model, covering streaming, response models, and tool calling functionalities.
…tions - Modified stream_chunks and astream_chunks functions to accept a max_chunks parameter, allowing for more flexible chunk consumption. - Updated tests for Kimi K2 Thinking model to utilize the new max_chunks functionality and ensure proper handling of streaming responses.
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
dragos199993
commented
Nov 19, 2025
| @@ -1,24 +1,26 @@ | |||
| def stream_chunks(ichunk): | |||
| def stream_chunks(ichunk, max_chunks=5): | |||
Member
Author
There was a problem hiding this comment.
I had to do this because this model is "thinking" out loud and it just spams the chunks
r0ymanesco
approved these changes
Nov 19, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Adds Moonshot AI’s Kimi K2 Thinking model with settings/env wiring, client routing, and tests for streaming, response models, and tool calling.
moonshotaiprovider innotdiamond/settings.pywithMOONSHOT_API_KEY, modelkimi-k2-thinking, tool/response-model support,openrouter_identifier, and pricing.NDLLMProviderswithKIMI_K2_THINKING._llm_from_configinnotdiamond/llms/client.pyto useChatOpenAIwithopenai_api_base="https://api.moonshot.cn/v1"formoonshotai.tests/test_llm_calls/test_moonshotai.pycovering streaming (sync/async), response model parsing, and tool calling (including OpenAI-style).Written by Cursor Bugbot for commit df290dc. Configure here.