INNER CODE UNIT · Python
get_llm_model_and_api
IvanIsCoding/ResuLLMe · src/Main.py:22
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(
"Select a model to use for the LLMs:",
["gpt-5.6-luna", "gpt-5.6-terra"],
index=0,
)
elif model_type == "Gemini":
api_key = os.getenv("GEMINI_API_KEY")
if not api_key:
api_key = st.text_input(
"Enter your Gemini API Key: [(click here to obtain a new key if you do not have one)](https://aistudio.google.com/apikey)",