Skip to content

Commit 5a52481

Browse files
madebygpsCopilot
andauthored
Update agents/langchainv1_keycloak.py
Co-authored-by: Copilot <[email protected]>
1 parent 49d490d commit 5a52481

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

agents/langchainv1_keycloak.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,14 @@
3434
load_dotenv(override=True)
3535

3636
# MCP Server and Keycloak configuration
37-
MCP_SERVER_URL = os.getenv(
38-
"MCP_SERVER_URL", "https://mcp-gps-key-n7pc5ej-ca.ashymeadow-ae27942e.eastus2.azurecontainerapps.io/mcp"
39-
)
40-
KEYCLOAK_REALM_URL = os.getenv(
41-
"KEYCLOAK_REALM_URL", "https://mcp-gps-key-n7pc5ej-kc.ashymeadow-ae27942e.eastus2.azurecontainerapps.io/realms/mcp"
42-
)
43-
37+
MCP_SERVER_URL = os.getenv("MCP_SERVER_URL")
38+
if not MCP_SERVER_URL:
39+
logger.error("Environment variable MCP_SERVER_URL is not set. Please set it to the MCP server URL.")
40+
raise RuntimeError("Missing required environment variable: MCP_SERVER_URL")
41+
KEYCLOAK_REALM_URL = os.getenv("KEYCLOAK_REALM_URL")
42+
if not KEYCLOAK_REALM_URL:
43+
logger.error("Environment variable KEYCLOAK_REALM_URL is not set. Please set it to the Keycloak realm URL.")
44+
raise RuntimeError("Missing required environment variable: KEYCLOAK_REALM_URL")
4445
# Configure language model based on API_HOST
4546
API_HOST = os.getenv("API_HOST", "github")
4647

0 commit comments

Comments
 (0)