Skip to content

How to pass secret keys to exported flow that is triggered using Python ? #3692

Answered by gauravdhiman
gauravdhiman asked this question in Q&A
Discussion options

You must be logged in to vote

On digging in code found that we can pass the API keys through Tweak object that we pass --OR-- explicitly set fallback_to_env_vars parameter to True while calling run_flow_from_json() and pass the path to .env file in env parameter.

Either of these approaches should work. I tried the first one (passing it using Tweak and it worked. Here is the tweak object that I passed and worked for me. Imp think to note here is also that we need to set load_from_db key as False, else langflow will look into DB not in tweak.

TWEAKS = {
  "ChatInput-9FOSJ": {},
  "ParseData-f3zpS": {},
  "Prompt-DJHnM": {},
  "ChatOutput-sHzFM": {},
  "SplitText-Tb2qB": {},
  "File-EXg8c": {},
  "OpenAIModel-N0opB": {},…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@gauravdhiman
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by gauravdhiman
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant