haystack icon indicating copy to clipboard operation
haystack copied to clipboard

docs: improve Secret Management section

Open anakin87 opened this issue 1 year ago • 3 comments

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.

anakin87 avatar Jun 26 '24 12:06 anakin87

@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.

srini047 avatar Jun 27 '24 05:06 srini047

@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"))

anakin87 avatar Jun 27 '24 08:06 anakin87

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

srini047 avatar Jun 27 '24 09:06 srini047

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

srini047 avatar Jul 02 '24 20:07 srini047

@dfokina please have a look when you can.

anakin87 avatar Jul 03 '24 07:07 anakin87

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

dfokina avatar Jul 03 '24 09:07 dfokina