mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-17 07:26:16 +00:00
core, partners: implement standard tracing params for LLMs (#25410)
This commit is contained in:
@@ -69,3 +69,31 @@ def test_fireworks_uses_actual_secret_value_from_secretstr() -> None:
|
||||
max_tokens=250,
|
||||
)
|
||||
assert cast(SecretStr, llm.fireworks_api_key).get_secret_value() == "secret-api-key"
|
||||
|
||||
|
||||
def test_fireworks_model_params() -> None:
|
||||
# Test standard tracing params
|
||||
llm = Fireworks(model="foo", api_key="secret-api-key") # type: ignore[arg-type]
|
||||
|
||||
ls_params = llm._get_ls_params()
|
||||
assert ls_params == {
|
||||
"ls_provider": "fireworks",
|
||||
"ls_model_type": "llm",
|
||||
"ls_model_name": "foo",
|
||||
}
|
||||
|
||||
llm = Fireworks(
|
||||
model="foo",
|
||||
api_key="secret-api-key", # type: ignore[arg-type]
|
||||
max_tokens=10,
|
||||
temperature=0.1,
|
||||
)
|
||||
|
||||
ls_params = llm._get_ls_params()
|
||||
assert ls_params == {
|
||||
"ls_provider": "fireworks",
|
||||
"ls_model_type": "llm",
|
||||
"ls_model_name": "foo",
|
||||
"ls_max_tokens": 10,
|
||||
"ls_temperature": 0.1,
|
||||
}
|
||||
|
Reference in New Issue
Block a user