code: def update_config():
      if (
          st.session_state.get("api_url", None) is None
          and st.session_state.get("proxy_key", None) is None
      ):
          st.warning(
              "Please configure the Proxy Endpoint and Proxy Key on the Proxy Setup page."
          )
  
      st.markdown("#### Alerting")
      input_slack_webhook = st.text_input(
          "Slack Webhook URL (Optional)",
          value=st.session_state.get("slack_webhook", ""),
          placeholder="https://hooks.slack.com/services/...",
      )
      st.markdown(
          "More information on Slack alerting configuration can be found in the [documentation]"
          "(https://docs.litellm.ai/docs/proxy/alerting)."
      )
      alerting_threshold = st.text_input(
          "Alerting threshold (in seconds) (Optional)",
          value=st.session_state.get("alerting_threshold", 300),
          placeholder=300,
      )
      st.markdown(
          "How long to wait before a request is considered hanging"
      )
      st.markdown("#### Logging")
  
      enable_langfuse_logging = st.checkbox("Enable Langfuse Logging")
      if enable_langfuse_logging == True:
          langfuse_host_url = st.text_input(
              "Langfuse Host",
              value=st.session_state.get(
                  "langfuse_host", "https://cloud.langfuse.com"
              ),
              placeholder="https://cloud.langfuse.com",
          )
          langfuse_public_key = st.text_input(
              "Langfuse Public Key",
              value=st.session_state.get("langfuse_public_key", ""),
              placeholder="pk-lf-...",
          )
          langfuse_secret_key = st.text_input(
              "Langfuse Secret Key",
              value=st.session_state.get("langfuse_secret_key", ""),
              placeholder="sk-lf-...",
          )
      # When the "Save" button is clicked, update the session state
      if st.button("Save"):
          try:
              config_post_body = {}
              if (
                  enable_langfuse_logging == True
                  and langfuse_host_url is not None
                  and langfuse_public_key is not None
                  and langfuse_secret_key is not None
              ):
                  config_post_body["litellm_settings"] = {
                      "success_callback": ["langfuse"]
                  }
                  config_post_body["environment_variables"] = {
                      "LANGFUSE_HOST": langfuse_host_url,
                      "LANGFUSE_PUBLIC_KEY": langfuse_public_key,
                      "LANGFUSE_SECRET_KEY": langfuse_secret_key,
                  }
              if (
                  input_slack_webhook is not None
                  and alerting_threshold is not None
              ):
                  config_post_body["general_settings"] = {
                      "alerting": ["slack"],
                      "alerting_threshold": alerting_threshold,
                  }
                  config_post_body["environment_variables"] = {
                      "SLACK_WEBHOOK_URL": input_slack_webhook
                  }
  
              # Make the POST request to the specified URL
              complete_url = ""
              if st.session_state["api_url"].endswith("/"):
                  complete_url = (
                      f"{st.session_state.get('api_url')}config/update"
                  )
              else:
                  complete_url = (
                      f"{st.session_state.get('api_url')}/config/update"
                  )
  
              headers = {
                  "Authorization": f"Bearer {st.session_state['proxy_key']}"
              }
              response = requests.post(
                  complete_url, json=config_post_body, headers=headers
              )
  
              if response.status_code == 200:
                  st.success(
                      f"Config updated successfully! - {response.json()}"
                  )
              else:
                  st.error(
                      f"Failed to update config. Status code: {response.status_code}. Error message: {response.json()['detail']}"
                  )
  
              st.success("Form submitted successfully!")
          except Exception as e:
              raise e
  
file_path: litellm/ui/admin.py
imports: from dotenv import load_dotenv
  import streamlit
  import base64, os, json, uuid, requests
label_desc: Use image node_id 7 for calling a global function with example usage: update_config() without return types