Commit b5acb91
Mask API keys for various LLM/ChatModel Modules (#13885)
**Description:**
- Added masking of the API Keys for the modules:
- `langchain/chat_models/openai.py`
- `langchain/llms/openai.py`
- `langchain/llms/google_palm.py`
- `langchain/chat_models/google_palm.py`
- `langchain/llms/edenai.py`
- Updated the modules to utilize `SecretStr` from pydantic to securely
manage API key.
- Added unit/integration tests
- `langchain/chat_models/asure_openai.py` used the `open_api_key` that
is derived from the `ChatOpenAI` Class and it was assuming
`openai_api_key` is a str so we changed it to expect `SecretStr`
instead.
**Issue:** #12165 ,
**Dependencies:** none,
**Tag maintainer:** @eyurtsev
---------
Co-authored-by: HassanA01 <[email protected]>
Co-authored-by: Aneeq Hassan <[email protected]>
Co-authored-by: kristinspenc <[email protected]>
Co-authored-by: faisalt14 <[email protected]>
Co-authored-by: Harshil-Patel28 <[email protected]>
Co-authored-by: kristinspenc <[email protected]>
Co-authored-by: faisalt14 <[email protected]>
Co-authored-by: Chester Curme <[email protected]>1 parent f99369a commit b5acb91
1 file changed
+12
-0
lines changedLines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
0 commit comments