Summary
I’m trying to deploy a Streamlit app that uses Langchain’s OpenAI and VertexAI integration. Is there any way to do so without exposing my Google Account credentials (json file)?
Steps to reproduce
Code snippet:
prompt_default = ChatPromptTemplate.from_messages([
SystemMessagePromptTemplate.from_template(system_tempate_default),
HumanMessagePromptTemplate.from_template(human_template_default),
])
if st.session_state["llm_provider"] == "OpenAI":
llm_default = ChatOpenAI(model="gpt-3.5-turbo", temperature=0.6, openai_api_key=openai_api_key, streaming=True)
elif st.session_state["llm_provider"] == "VertexAI":
llm_default = VertexAI(temperature=0.4, max_output_tokens=512)
chain_default = LLMChain(llm=llm_default, prompt=prompt_default, memory=memory, verbose=True)
Additional information
The app works in my local environment where Langchain will use the environment variable GOOGLE_APPLICATION_CREDENTIALS (which is a path to the local .json file). But I’m not sure how to deploy this the Streamlit Cloud?
Many thanks!