v2.5.0 (#495)
Co-authored-by: Quentin Torroba <quentin.torroba@mistral.ai> Co-authored-by: Clement Sirieix <clem.sirieix@gmail.com> Co-authored-by: Kim-Adeline Miguel <kimadeline.miguel@mistral.ai> Co-authored-by: Simon Van de Kerckhove <simon.vandekerckhove@mistral.ai> Co-authored-by: Vincent Guilloux <vincent.guilloux@mistral.ai> Co-authored-by: Michel Thomazo <michel.thomazo@mistral.ai> Co-authored-by: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
parent
9421fbc08e
commit
5103019b01
104 changed files with 7277 additions and 691 deletions
|
|
@ -16,7 +16,7 @@ import json
|
|||
from unittest.mock import MagicMock, patch
|
||||
|
||||
import httpx
|
||||
from mistralai.utils.retries import BackoffStrategy, RetryConfig
|
||||
from mistralai.client.utils.retries import BackoffStrategy, RetryConfig
|
||||
import pytest
|
||||
import respx
|
||||
|
||||
|
|
@ -426,7 +426,7 @@ class TestMistralRetry:
|
|||
async def test_client_creation_includes_timeout_and_retry_config(self):
|
||||
backend = self._create_test_backend()
|
||||
|
||||
with patch("mistralai.Mistral") as mock_mistral_class:
|
||||
with patch("vibe.core.llm.backend.mistral.Mistral") as mock_mistral_class:
|
||||
mock_mistral_class.return_value = MagicMock()
|
||||
backend._get_client()
|
||||
mock_mistral_class.assert_called_once_with(
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ class TestThinkingBlocksConversion:
|
|||
reasoning_content="Let me think...",
|
||||
),
|
||||
]
|
||||
payload = _prepare(adapter, provider, messages)
|
||||
payload = _prepare(adapter, provider, messages, thinking="medium")
|
||||
msg = payload["messages"][1]
|
||||
assert msg["content"] == [
|
||||
{
|
||||
|
|
@ -87,6 +87,18 @@ class TestThinkingBlocksConversion:
|
|||
{"type": "text", "text": "Answer"},
|
||||
]
|
||||
|
||||
def test_reasoning_stripped_when_thinking_off(self, adapter, provider):
|
||||
messages = [
|
||||
LLMMessage(role=Role.user, content="Hi"),
|
||||
LLMMessage(
|
||||
role=Role.assistant,
|
||||
content="Answer",
|
||||
reasoning_content="Let me think...",
|
||||
),
|
||||
]
|
||||
payload = _prepare(adapter, provider, messages, thinking="off")
|
||||
assert payload["messages"][1]["content"] == "Answer"
|
||||
|
||||
def test_assistant_without_reasoning_is_plain_string(self, adapter, provider):
|
||||
messages = [
|
||||
LLMMessage(role=Role.user, content="Hi"),
|
||||
|
|
@ -111,7 +123,7 @@ class TestThinkingBlocksConversion:
|
|||
],
|
||||
),
|
||||
]
|
||||
payload = _prepare(adapter, provider, messages)
|
||||
payload = _prepare(adapter, provider, messages, thinking="medium")
|
||||
msg = payload["messages"][1]
|
||||
assert msg["content"][0]["type"] == "thinking"
|
||||
assert msg["content"][1] == {"type": "text", "text": "Let me search."}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue