Etape 2 fini
This commit is contained in:
22
backend/tests/test_mistral.py
Normal file
22
backend/tests/test_mistral.py
Normal file
@@ -0,0 +1,22 @@
|
||||
import httpx
|
||||
from langchain_openai import ChatOpenAI
|
||||
from app.core.config import settings
|
||||
|
||||
sync_client = httpx.Client(verify=False)
|
||||
async_client = httpx.AsyncClient(verify=False)
|
||||
|
||||
llm = ChatOpenAI(
|
||||
base_url=settings.llm_base_url,
|
||||
api_key=settings.llm_api_key,
|
||||
model=settings.llm_model,
|
||||
temperature=0.3,
|
||||
http_client=sync_client,
|
||||
http_async_client=async_client
|
||||
)
|
||||
|
||||
try:
|
||||
print("\n=== Appell LLM... ===")
|
||||
res = llm.invoke("Dis bonjour en un mot.")
|
||||
print(f"Réponse du modèle : {res.content}")
|
||||
except Exception as e:
|
||||
print(f"\n❌ Erreur détectée : {e}")
|
||||
Reference in New Issue
Block a user