Skip to content

Commit 91c99e6

Browse files
committed
fix(pc):
1 parent 1226e20 commit 91c99e6

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

agentic_security/http_spec.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import base64
22
from enum import Enum
3-
43
from urllib.parse import urlparse
4+
55
import httpx
66
from pydantic import BaseModel
77

@@ -161,11 +161,13 @@ def parse_http_spec(http_spec: str) -> LLMSpec:
161161
method, url = lines[0].split(" ")[0:2]
162162

163163
# Check url validity
164-
valid_url= urlparse(url)
165-
# if missing the correct formatting ://, urlparse.netloc will be empty
166-
if valid_url.scheme not in ("http", "https") or not valid_url.netloc:
167-
raise InvalidHTTPSpecError(f"Invalid URL: {url}. Ensure it starts with 'http://' or 'https://'")
168-
164+
valid_url = urlparse(url)
165+
# if missing the correct formatting ://, urlparse.netloc will be empty
166+
if valid_url.scheme not in ("http", "https") or not valid_url.netloc:
167+
raise InvalidHTTPSpecError(
168+
f"Invalid URL: {url}. Ensure it starts with 'http://' or 'https://'"
169+
)
170+
169171
# Initialize headers and body
170172
headers = {}
171173
body = ""

agentic_security/probe_data/modules/rl_model.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@ def update_rewards(
121121
current_prompt: str,
122122
reward: float,
123123
passed_guard: bool,
124-
) -> None: ...
124+
) -> None:
125+
...
125126

126127

127128
class QLearningPromptSelector(PromptSelectionInterface):

0 commit comments

Comments
 (0)