v2.9.1 (#644)
Co-authored-by: Brice Carpentier <brice.carpentier@mistral.ai> Co-authored-by: Clément Drouin <clement.drouin@mistral.ai> Co-authored-by: Clément Sirieix <clement.sirieix@mistral.ai> Co-authored-by: Kim-Adeline Miguel <51720070+kimadeline@users.noreply.github.com> Co-authored-by: Lucas Marandat <31749711+lucasmrdt@users.noreply.github.com> Co-authored-by: Michel Thomazo <51709227+michelTho@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: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
parent
632ea8c032
commit
1fd7eea289
63 changed files with 3482 additions and 301 deletions
|
|
@ -400,3 +400,28 @@ async def test_generic_provider_has_no_metadata_header() -> None:
|
|||
headers = backend.requests_extra_headers[0]
|
||||
assert headers is not None
|
||||
assert "metadata" not in headers
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_provider_extra_headers_are_forwarded() -> None:
|
||||
backend = FakeBackend([mock_llm_chunk(content="Response")])
|
||||
providers = [
|
||||
ProviderConfig(
|
||||
name="custom",
|
||||
api_base="https://custom.example.com/v1",
|
||||
extra_headers={"X-Custom-Auth": "token123", "X-Org-Id": "org-456"},
|
||||
)
|
||||
]
|
||||
models = [ModelConfig(name="test-model", provider="custom", alias="test")]
|
||||
config = build_test_vibe_config(
|
||||
active_model="test", models=models, providers=providers
|
||||
)
|
||||
agent = build_test_agent_loop(config=config, backend=backend)
|
||||
|
||||
[_ async for _ in agent.act("Hello")]
|
||||
|
||||
assert len(backend.requests_extra_headers) == 1
|
||||
headers = backend.requests_extra_headers[0]
|
||||
assert headers is not None
|
||||
assert headers["X-Custom-Auth"] == "token123"
|
||||
assert headers["X-Org-Id"] == "org-456"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue