deepset-ai / haystack

:mag: LLM orchestration framework to build customizable, production-ready LLM applications. Connect components (models, vector DBs, file converters) to pipelines or agents that can interact with your data. With advanced retrieval methods, it's best suited for building RAG, question answering, semantic search or conversational agent chatbots.
https://haystack.deepset.ai
Apache License 2.0
14.5k stars 1.71k forks source link

docs: improve Secret Management section #7936

Open anakin87 opened 1 week ago

anakin87 commented 1 week ago

I have noticed on some online examples that some users struggle to understand how our Secret Management works. #1 #2

I think that our docs should begin with one of two simple practical usage examples (useful for ordinary users), before going deep into explaining the implementation.

srini047 commented 6 days ago

@anakin87 I would like to take up this issue. A pipeline similar to this: https://github.com/LLM-Projects/haystack-book/blob/main/chapter-4/haystack_monitoring_prompt_injection.ipynb.

anakin87 commented 6 days ago

@srini047 it is unrelated, sorry.

I simply mean showing an example like this:

works, but not serializable generator = OpenAIGenerator(api_key=Secret.from_token("<your-api-key>"))

serializable, preferred way

# export an env var called OPENAI_API_KEY containing the API key
generator = OpenAIGenerator() #using the default env var for the component

serializable, with a custom env var

# export an env var called YOUR_ENV_VAR containing the API key
generator = OpenAIGenerator(api_key=Secret.from_env("YOUR_ENV_VAR"))
srini047 commented 6 days ago

I actually thought an example as a pipeline. I can implement this and looks much simpler.

srini047 commented 19 hours ago

@anakin87 Suggested the changes through dash.readme.com. Looking forward to take it from there.

anakin87 commented 8 hours ago

@dfokina please have a look when you can.

dfokina commented 6 hours ago

Thank you @srini047 ! I just tweaked the text a little bit, and just published the suggestions.