INNER CODE UNIT · Python
select_llm_model
IvanIsCoding/ResuLLMe · src/Main.py:13
def select_llm_model():
model_type = st.selectbox(
"Select the model you want to use:",
["OpenAI", "Gemini", "Self-Hosted"],
index=1
)
return model_type
def get_llm_model_and_api(model_type):
if model_type == "OpenAI":
api_key = os.getenv("OPENAI_API_KEY")
if not api_key:
api_key = st.text_input(
"Enter your OpenAI API Key: [(click here to obtain a new key if you do not have one)](https://platform.openai.com/account/api-keys)",
type="password",
)
api_model = os.getenv("OPENAI_DEFAULT_MODEL") or st.selectbox(