Skip to content

Commit 46bbd55

Browse files
committed
Added a test-case for the mistralai api
1 parent 6844657 commit 46bbd55

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

tests/test_llm_api.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,25 @@
1616
sys.path.append(".")
1717

1818

19+
def test_mistral_model():
20+
from langchain_core.messages import HumanMessage
21+
from src.utils import utils
22+
23+
llm = utils.get_llm_model(
24+
provider="mistral",
25+
model_name="mistral-large-latest",
26+
temperature=0.8,
27+
base_url=os.getenv("MISTRAL_ENDPOINT", ""),
28+
api_key=os.getenv("MISTRAL_API_KEY", "")
29+
)
30+
message = HumanMessage(
31+
content=[
32+
{"type": "text", "text": "who are you?"}
33+
]
34+
)
35+
ai_msg = llm.invoke([message])
36+
print(ai_msg.content)
37+
1938
def test_openai_model():
2039
from langchain_core.messages import HumanMessage
2140
from src.utils import utils
@@ -128,4 +147,5 @@ def test_ollama_model():
128147
# test_gemini_model()
129148
# test_azure_openai_model()
130149
# test_deepseek_model()
131-
test_ollama_model()
150+
# test_ollama_model()
151+
test_mistral_model()

0 commit comments

Comments
 (0)