Skip to content

Commit

Permalink
fix: Allow cohere_api_key to be SecretStr in CohereEmbedding (#102)
Browse files Browse the repository at this point in the history
Resolves issue
#101
  • Loading branch information
Anirudh31415926535 authored Oct 14, 2024
1 parent 9a9681d commit 27262d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions libs/cohere/langchain_cohere/embeddings.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ def validate_environment(cls, values: Dict) -> Any:
cohere_api_key = get_from_dict_or_env(
values, "cohere_api_key", "COHERE_API_KEY"
)
if isinstance(cohere_api_key, SecretStr):
cohere_api_key = cohere_api_key.get_secret_value()

request_timeout = values.get("request_timeout")

client_name = values.get("user_agent", "langchain:partner")
Expand Down
2 changes: 1 addition & 1 deletion libs/cohere/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "langchain-cohere"
version = "0.3.0"
version = "0.3.1"
description = "An integration package connecting Cohere and LangChain"
authors = []
readme = "README.md"
Expand Down

0 comments on commit 27262d8

Please sign in to comment.