Co-authored-by: Clément Drouin <clement.drouin@mistral.ai>
Co-authored-by: Clément Sirieix <clement.sirieix@mistral.ai>
Co-authored-by: Cyprien <courtot.c@gmail.com>
Co-authored-by: Guillaume LE GOFF <guillaume.lgf@gmail.com>
Co-authored-by: Jean Burellier <sheplu@users.noreply.github.com>
Co-authored-by: Kim-Adeline Miguel <51720070+kimadeline@users.noreply.github.com>
Co-authored-by: Mathias Gesbert <mathias.gesbert@mistral.ai>
Co-authored-by: Nelson PROIA <144663685+Nelson-PROIA@users.noreply.github.com>
Co-authored-by: Paul VEZIA <166131032+le-codeur-rapide@users.noreply.github.com>
Co-authored-by: Pierre Rossinès <pierre.rossines@mistral.ai>
Co-authored-by: Quentin <quentin.torroba@mistral.ai>
Co-authored-by: Vincent G <10739306+VinceOPS@users.noreply.github.com>
Co-authored-by: josephine-delas <57808586+josephine-delas@users.noreply.github.com>
Co-authored-by: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
Laure Hugo 2026-06-25 16:08:45 +02:00 committed by GitHub
parent 725d3a56ce
commit e607ccbb00
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
242 changed files with 7372 additions and 1974 deletions

View file

@ -0,0 +1,65 @@
from __future__ import annotations
import json
from typing import Any
from tests import constants as c
from tests.agent_loop.e2e.providers.base import ProviderAPI
from tests.backend.data import Chunk, JsonResponse
from tests.backend.data.reasoning import (
reasoning_message,
reasoning_text_stream,
reasoning_thinking_message,
reasoning_thinking_tool_use_stream,
reasoning_tool_use,
)
from tests.conftest import build_test_vibe_config
from vibe.core.config import ModelConfig, ProviderConfig, ThinkingLevel, VibeConfig
from vibe.core.types import Backend
def e2e_config(*, thinking: ThinkingLevel = "off", **overrides: Any) -> VibeConfig:
provider = ProviderConfig(
name="reasoning",
api_base=c.REASONING_BASE_URL,
api_key_env_var="REASONING_API_KEY",
api_style="reasoning",
backend=Backend.GENERIC,
)
models = [
ModelConfig(
name="reasoning-test",
provider="reasoning",
alias="reasoning",
thinking=thinking,
)
]
return build_test_vibe_config(
active_model="reasoning", models=models, providers=[provider], **overrides
)
class API(ProviderAPI):
base_url = c.REASONING_BASE_URL
post_path = c.REASONING_COMPLETIONS_PATH
class Mocks:
def answer(self, text: str) -> JsonResponse:
return reasoning_message(text)
def text_stream(self, text: str) -> list[Chunk]:
return reasoning_text_stream(text)
def tool_call(self, name: str, arguments: dict[str, Any]) -> JsonResponse:
return reasoning_tool_use(name, json.dumps(arguments))
def reasoning_answer(self, text: str, reasoning: str) -> JsonResponse:
return reasoning_thinking_message(text, reasoning)
def reasoning_tool_call_stream(
self, name: str, arguments: dict[str, Any], *, reasoning: str
) -> list[Chunk]:
return reasoning_thinking_tool_use_stream(
name, json.dumps(arguments), reasoning=reasoning
)