langchain-ai / langchain

πŸ¦œπŸ”— Build context-aware reasoning applications
https://python.langchain.com
MIT License
93.08k stars 14.97k forks source link

For New Contributors: Use SecretStr for api_keys #12165

Closed eyurtsev closed 10 months ago

eyurtsev commented 11 months ago

Updated: 20233-12-06

Hello everyone! thank you all for your contributions! We've made a lot of progress with SecretStrs in the code base.

First time contributors -- hope you had fun learning how to work in the code base and thanks for putting in the time. All contributors -- thanks for all your efforts in improving LangChain.

We'll create a new first time issue in a few months.


Hello LangChain community,

We're always happy to see more folks getting involved in contributing to the LangChain codebase.

This is a good first issue if you want to learn more about how to set up for development in the LangChain codebase.

Goal

Your contribution will make it safer to print out a LangChain object without having any secrets included in raw format in the string representation.

Set up for development

Prior to making any changes in the code:

https://github.com/langchain-ai/langchain/blob/master/.github/CONTRIBUTING.md

Make sure you're able to test, format, lint from langchain/libs/langchain

make test
make format
make lint

Shall you accept

Shall you accept this challenge, please claim one (and only one) of the modules from the list below as one that you will be working on, and respond to this issue.

Once you've made the required code changes, open a PR and link to this issue.

Acceptance Criteria

Integration test for the code updated to include tests that:

Confirm that it works:

If your code does not use get_secret_value() somewhere, then it probably contains a bug!

Modules

Motivation

Prevent secrets from being printed out when printing the given langchain object.

Your contribution

Please sign up by responding to this issue and including the name of the module.

HassanA01 commented 11 months ago

Hey @eyurtsev ! I am working with a group of 4 and would like to tackle this issue for my project at my course. Do you think completing these modules would be feasible in a month?

eyurtsev commented 11 months ago

@HassanA01 yes definitely. But the work is very similar across all the modules -- I would suggest selecting a single module per individual and should be just a few lines of code. This is a good entry point to set up for development w/ langchain and learn a little bit about the code structure

HassanA01 commented 11 months ago

@eyurtsev Sounds good! Also, could you recommend an issue that might be a little bit more complex but doesn't require too much knowledge about the in-depths of langchain which we can also tackle and would be feasible to complete in 2-3 weeks

eyurtsev commented 11 months ago

Not of the top of my head, but I'll think some -- in the meantime feel free to scan through the list of issues or feature requests to see if something stands out.

faisalt14 commented 11 months ago

Hey, I’m also part of @HassanA01’s group and am planning to work on the langchain/chat_models/google_palm.py module. 😁

HassanA01 commented 11 months ago

No worries! My group and I will get started to tackle this issue. I'll work on the langchain/llms/openai.py module!

HassanA01 commented 11 months ago

@eyurtsev Is it fine if as a group of 5, we make one PR to the upstream main with 5 module fixes (1 per team member)?

AnasKhan0607 commented 11 months ago

Another member of the team 🫑. Will be tackling the langchain/chat_models/openai.py module.

eyurtsev commented 11 months ago

@HassanA01 totally fine -- claim the modules that you want :)

Harshil-Patel28 commented 11 months ago

Hey @eyurtsev. I'm also a member of the team. Ill be working on the langchain/llms/google_palm.py module 😊

arunsathiya commented 11 months ago

I have taken langchain/llms/cohere.py:

kristinspenc commented 11 months ago

Hey, I’m also part of @HassanA01’s group and am planning to work on the langchain/llms/edenai.py module.

aidoskanapyanov commented 11 months ago

Hi @eyurtsev! Thanks for creating this "good first issue" πŸ‘. Can you please assign me on langchain/chat_models/anyscale.py and langchain/llms/anyscale.py?

onesolpark commented 11 months ago

Hey @eyurtsev thanks for setting this up. Can you assign me to langchain/chat_models/azure_openai.py. Happy to get involved in contributing to the LangChain codebase.

aidoskanapyanov commented 11 months ago

@eyurtsev I'm having an issue with installing the dependencies with poetry. It automatically removes some of the libraries. Then I end up with ModuleNotFoundError: No module named 'rapidfuzz' error when trying to run tests or anything with poety. It's related to this issue #12237.

For anyone facing this issue, as a workaround for now I installed the missing packages like so:

python -m pip install rapidfuzz
python -m pip install filelock
python -m pip install msgpack
python -m pip install build
slangenbach commented 11 months ago

@eyurtsev, thanks for making it easy for future contributors to get going. You can sign me up for langchain/llms/aleph_alpha.py

nepalprabin commented 11 months ago

Been using Langchain for a while. Thanks @eyurtsev for setting this up. Hope I can return something useful to the community. You can sign me up for langchain/chat_models/fireworks.py.

gautamanirudh commented 11 months ago

Hey @eyurtsev, You can assign me to langchain/llms/ai21.py.

nepalprabin commented 11 months ago

Been using Langchain for a while. Thanks @eyurtsev for setting this up. Hope I can return something useful to the community. You can sign me up for langchain/chat_models/fireworks.py.

I implemented SecretStr for fireworks but while testing, do I need to bypass fireworks package or simply @pytest.mark.requires("openai") works? @eyurtsev

samadkoita commented 11 months ago

@eyurtsev Thanks for this initiative. I have taken a crack at langchain/llms/gooseai.py https://github.com/langchain-ai/langchain/pull/12496

nepalprabin commented 11 months ago

Been using Langchain for a while. Thanks @eyurtsev for setting this up. Hope I can return something useful to the community. You can sign me up for langchain/chat_models/fireworks.py.

I implemented SecretStr for fireworks but while testing, do I need to bypass fireworks package or simply @pytest.mark.requires("openai") works? @eyurtsev

#12475

ommirzaei commented 11 months ago

Hey @eyurtsev Thanks for setting this up. Could you please assign me to langchain/llms/writer.py. Thanks!

sfreisthler commented 11 months ago

Hi @eyurtsev, can you please assign me to langchain/chat_models/everlyai.py? Thanks!

akshatvishu commented 11 months ago

Hey @eyurtsev , I would like to work on langchain/llms/petals.py. Thanks!

fyasla commented 11 months ago

Hello :wave:, Thank you for setting this up! I have started to work on langchain/chat_models/azureml_endpoint.py

praveenv commented 11 months ago

Hi, noticed that no one was working on langchain/llms/symblai_nebula.py, so just submitted a PR for it.

pkcodesat commented 11 months ago

@eyurtsev Kindly assign langchain/llms/azureml_endpoint.py to me. Thanks!

hiroshitashir commented 11 months ago

Created PRs for:

Zekrom-7780 commented 11 months ago

@eyurtsev , I'll take up langchain/llms/yandex.py

ilyazub commented 11 months ago

Hi. In https://github.com/langchain-ai/langchain/pull/13207, I masked API keys that are used in langchain/utilities/serpapi.py and langchain/utilities/google_scholar.py.

faisale commented 11 months ago

@eyurtsev, I'll handle langchain/llms/pipelineai.py.

Muhmdk commented 10 months ago

Hey @eyurtsev, Thank you for setting this up, I would love to work on langchain/llms/azureml_endpoint.py.

ch1zzzz commented 10 months ago

Hi @eyurtsev, could you please assign me langchain/chat_models/baichuan.py? Thanks!

HassanFazal97 commented 10 months ago

Hey @eyurtsev, I would like to work on langchain/llms/anthropic.py. Could you assign me to that please

shivangsoni commented 10 months ago

Hi @eyurtsev, Can you please assign langchain/llms/fireworks.py to me?

kahlkritzinger commented 10 months ago

Hey @eyurtsev, please assign langchain/llms/stochasticai.py to myself. Thanks for setting this up!

chennavc commented 10 months ago

Hey @eyurtsev, I'd like to contribute to issue #12165 by working on the langchain/llms/azureml_endpoint.py module. I'm prepared to implement SecretStr for API keys, ensuring enhanced security. Looking forward to making a positive impact!

zuhorer commented 10 months ago

hey @eyurtsev, I would like to take up: langchain/llms/anthropic.py could you please assign the same to me?

raphaelreiss commented 10 months ago

Hi @eyurtsev, I would like to take: langchain/llms/arcee.py. Thank you for this nice setup !

chyroc commented 10 months ago

@eyurtsev coule you please assign me langchain/chat_models/jinachat.py, thanks

yliang412 commented 10 months ago

Hi @eyurtsev, could you please assign me langchain/llms/cerebriumai.py, thanks!

xavier-xia-99 commented 10 months ago

Hello @eyurtsev Could you please assign me langchain/chat_models/litellm.py :)

lwunder commented 10 months ago

Hi @eyurtsev could I get assigned to langchain/llms/predibase.py? Thanks!

normand1 commented 10 months ago

Hi @eyurtsev thanks for the great issue, please assign langchain/llms/together.py to me please, thanks!

nhywieza commented 10 months ago

Hi @eyurtsev , could you please assign me langchain/chat_models/baichuan.py? thanks

lujingxuansc commented 10 months ago

Hi @eyurtsev , could you please assign me langchain/llms/nlpcloud.py? thanks

chrismcgale commented 10 months ago

Hi @eyurtsev, I'd like to help with llms/minimax. Will get started now if you could assign it to me, thanks.

mmahmad commented 10 months ago

I'll take langchain/llms/anthropic.py

Edit: Oops, looks like it was already covered in https://github.com/langchain-ai/langchain/pull/11185.

@eyurtsev you can mark anthropic as resolved from the checklist.

zuhorer commented 10 months ago

I'll take langchain/llms/anthropic.py

Edit: Oops, looks like it was already covered in https://github.com/langchain-ai/langchain/pull/11185.

@eyurtsev you can mark anthropic as resolved from the checklist.

Hi, I believe there has been a confusion as the issues are not checked for a while. I asked to assigned to llm/anthropic. Hopefully you can take another issueπŸ™‚. It would be really helpfully.

Sierrra commented 10 months ago

Hi @eyurtsev ! Could you please check my PR #13649 for langchain/llms/yandex.py ?