Skip to content

Commit 124a76f

Browse files
committed
fix: support custom region in guardrails
1 parent a8e4830 commit 124a76f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

veadk/tools/builtin_tools/llm_shield.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,18 @@ class LLMShieldPlugin(BasePlugin):
5353
```
5454
"""
5555

56-
def __init__(self, region: str = "cn-beijing", timeout: int = 50) -> None:
56+
def __init__(self, timeout: int = 50) -> None:
5757
"""
5858
Initialize the LLM Shield Plugin.
5959
6060
Args:
61-
region (str, optional): The service region. Defaults to "cn-beijing".
6261
timeout (int, optional): Request timeout in seconds. Defaults to 50.
6362
"""
6463
self.name = "LLMShieldPlugin"
6564
super().__init__(name=self.name)
6665

6766
self.appid = getenv("TOOL_LLM_SHIELD_APP_ID")
68-
self.region = region
67+
self.region = getenv("TOOL_LLM_SHIELD_REGION", "cn-beijing")
6968
self.timeout = timeout
7069
self.url = getenv(
7170
"TOOL_LLM_SHIELD_URL",

0 commit comments

Comments
 (0)