core, partners: implement standard tracing params for LLMs (#25410)

This commit is contained in:
ccurme
2024-08-16 13:18:09 -04:00
committed by GitHub
parent 9f0c76bf89
commit b83f1eb0d5
17 changed files with 298 additions and 36 deletions

View File

@@ -6,3 +6,23 @@ from langchain_ollama import OllamaLLM
def test_initialization() -> None:
"""Test integration initialization."""
OllamaLLM(model="llama3")
def test_model_params() -> None:
# Test standard tracing params
llm = OllamaLLM(model="llama3")
ls_params = llm._get_ls_params()
assert ls_params == {
"ls_provider": "ollama",
"ls_model_type": "llm",
"ls_model_name": "llama3",
}
llm = OllamaLLM(model="llama3", num_predict=3)
ls_params = llm._get_ls_params()
assert ls_params == {
"ls_provider": "ollama",
"ls_model_type": "llm",
"ls_model_name": "llama3",
"ls_max_tokens": 3,
}