mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-24 20:09:01 +00:00
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:
@@ -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) == "**********"
|
||||
|
Reference in New Issue
Block a user