[Bugfix] Fix mistral model tests (#17181)

Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
This commit is contained in:
Cyrus Leung
2025-04-25 21:03:34 +08:00
committed by GitHub
parent 7feae92c1f
commit 19dcc02a72
2 changed files with 39 additions and 27 deletions

View File

@@ -38,6 +38,10 @@ class MistralToolCall(ToolCall):
# https://github.com/mistralai/mistral-common/blob/21ee9f6cee3441e9bb1e6ed2d10173f90bd9b94b/src/mistral_common/protocol/instruct/validator.py#L299
return "".join(choices(ALPHANUMERIC, k=9))
@staticmethod
def is_valid_id(id: str) -> bool:
return id.isalnum() and len(id) == 9
@ToolParserManager.register_module("mistral")
class MistralToolParser(ToolParser):