fix(agent): URLs OpenAI-compatibles validees pour les fournisseurs LLM
Cohere -> /compatibility/v1, Google Gemini -> /v1beta/openai, Perplexity -> host racine, Chutes -> llm.chutes.ai/v1, SenseNova -> compatible-mode/v1. Mise a jour des modeles par defaut (xAI grok-4.6, Fireworks deepseek-v4-pro-0813, Cohere command-a-plus). Retrait de LTX Studio (aucune API chat-completions) et MemTensor/MemOS (API memoire non OpenAI-compatible, auth Token + /chat). Google utilise desormais l'auth Bearer pour lister les modeles. Test de non-regression ajoute.
This commit is contained in:
@@ -88,6 +88,24 @@ def test_llm_client_providers_listed(client):
|
||||
assert name in PROVIDERS
|
||||
|
||||
|
||||
def test_llm_client_openai_compatible_bases(client):
|
||||
"""Providers that need an OpenAI-compatible surface must point at it.
|
||||
|
||||
Anthropic/Google/Cohere native APIs are not chat-completions endpoints:
|
||||
the client always speaks `/chat/completions` with a Bearer token, so the
|
||||
base URLs must target the compatibility surfaces (validated live).
|
||||
"""
|
||||
from app.services.llm_client import PROVIDERS
|
||||
assert PROVIDERS["cohere"][0] == "https://api.cohere.ai/compatibility/v1"
|
||||
assert PROVIDERS["google"][0] == (
|
||||
"https://generativelanguage.googleapis.com/v1beta/openai")
|
||||
# Perplexity serves /chat/completions at the host root (no /v1 prefix).
|
||||
assert PROVIDERS["perplexity"][0] == "https://api.perplexity.ai"
|
||||
# Chutes' OpenAI-compatible inference host.
|
||||
assert PROVIDERS["chutes"][0] == "https://llm.chutes.ai/v1"
|
||||
assert PROVIDERS["sensenova"][0].endswith("/compatible-mode/v1")
|
||||
|
||||
|
||||
def test_llm_client_offline_no_credentials(client):
|
||||
from app.services.llm_client import LLMClient
|
||||
llm = LLMClient(provider="openai", api_key="")
|
||||
|
||||
Reference in New Issue
Block a user