community[patch]: standardize init args, update for javelin sdk release. (#21980)

Related to
[20085](https://github.com/langchain-ai/langchain/issues/20085) Updated
the Javelin chat model to standardize the initialization argument. Also
fixed an existing bug, where code was initialized with incorrect call to
the JavelinClient defined in the javelin_sdk, resulting in an
initialization error. See related [Javelin
Documentation](https://docs.getjavelin.io/docs/javelin-python/quickstart).
This commit is contained in:
MSubik
2024-05-23 03:17:28 +05:30
committed by GitHub
parent 16617dd239
commit d948783a4c
2 changed files with 21 additions and 2 deletions

View File

@@ -30,3 +30,17 @@ def test_api_key_masked_when_passed_via_constructor() -> None:
assert str(llm.javelin_api_key) == "**********"
assert "secret-api-key" not in repr(llm.javelin_api_key)
assert "secret-api-key" not in repr(llm)
@pytest.mark.requires("javelin_sdk")
def test_api_key_alias() -> None:
for model in [
ChatJavelinAIGateway(
route="<javelin-ai-gateway-chat-route>",
javelin_api_key="secret-api-key",
),
ChatJavelinAIGateway(
route="<javelin-ai-gateway-chat-route>", api_key="secret-api-key"
),
]:
assert str(model.javelin_api_key) == "**********"