-
Notifications
You must be signed in to change notification settings - Fork 15.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SecretStr for fireworks api #12475
SecretStr for fireworks api #12475
Conversation
nepalprabin
commented
Oct 28, 2023
•
edited
Loading
edited
- Description: This pull request removes secrets present in raw format,
- Issue: Fireworks api key was exposed when printing out the langchain object #12165
- Maintainer: @eyurtsev
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Let's change the requires to use fireworks rather than openai and should be ready to merge!
assert isinstance(llm.fireworks_api_key, SecretStr) | ||
|
||
|
||
@pytest.mark.requires("openai") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should require fireworks
rather than openai
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When using
@pytest.mark.requires("fireworks")
def test_api_key_masked_when_passed_from_env(
monkeypatch: MonkeyPatch, capsys: CaptureFixture
) -> None:
monkeypatch.setenv("FIREWORKS_API_KEY", "secret-api-key")
llm = ChatFireworks()
print(llm.fireworks_api_key, end="")
captured = capsys.readouterr()
assert captured.out == "**********"
my test fails, but it gets passed when using openai
. But all other testcase gets passed. Am I missing something here?
@eyurtsev
- **Description:** This pull request removes secrets present in raw format, - **Issue:** Fireworks api key was exposed when printing out the langchain object [langchain-ai#12165](langchain-ai#12165) - **Maintainer:** @eyurtsev --------- Co-authored-by: Bagatur <[email protected]>
- **Description:** This pull request removes secrets present in raw format, - **Issue:** Fireworks api key was exposed when printing out the langchain object [langchain-ai#12165](langchain-ai#12165) - **Maintainer:** @eyurtsev --------- Co-authored-by: Bagatur <[email protected]>