Fix MoonshotChatConfig to address limitations of kimi-thinking-preview model by excluding additional parameters (#12772)

This commit is contained in:
Cole McIntosh 2025-07-19 16:10:57 -06:00 • committed by GitHub
parent 93badc72dc
commit bd134fa2db
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -83,8 +83,14 @@ class MoonshotChatConfig(OpenAIGPTConfig):
Moonshot AI limitations:
- functions parameter is not supported (use tools instead)
- tool_choice doesn't support "required" value
- kimi-thinking-preview doesn't support tool calls at all
"""
excluded_params: List[str] = ["functions"]
# kimi-thinking-preview has additional limitations
if "kimi-thinking-preview" in model:
excluded_params.extend(["tools", "tool_choice"])
base_openai_params = super().get_supported_openai_params(model=model)
final_params: List[str] = []
for param in base_openai_params: