mirror of
https://github.com/msoedov/agentic_security.git
synced 2026-09-30 19:59:34 +02:00
fix(pc):
This commit is contained in:
1 parent
1226e2059d
commit
91c99e642f
2 files changed
+6
-3
No files matched your search
@@ -1,7 +1,7 @@
|
|||||||
import base64
|
import base64
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
|
|
||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
|
|
||||||
import httpx
|
import httpx
|
||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
|
|
||||||
@@ -164,7 +164,9 @@ def parse_http_spec(http_spec: str) -> LLMSpec:
|
|||||||
valid_url = urlparse(url)
|
valid_url = urlparse(url)
|
||||||
# if missing the correct formatting ://, urlparse.netloc will be empty
|
# if missing the correct formatting ://, urlparse.netloc will be empty
|
||||||
if valid_url.scheme not in ("http", "https") or not valid_url.netloc:
|
if valid_url.scheme not in ("http", "https") or not valid_url.netloc:
|
||||||
raise InvalidHTTPSpecError(f"Invalid URL: {url}. Ensure it starts with 'http://' or 'https://'")
|
raise InvalidHTTPSpecError(
|
||||||
|
f"Invalid URL: {url}. Ensure it starts with 'http://' or 'https://'"
|
||||||
|
)
|
||||||
|
|
||||||
# Initialize headers and body
|
# Initialize headers and body
|
||||||
headers = {}
|
headers = {}
|
||||||
|
|||||||
@@ -121,7 +121,8 @@ class CloudRLPromptSelector(PromptSelectionInterface):
|
|||||||
current_prompt: str,
|
current_prompt: str,
|
||||||
reward: float,
|
reward: float,
|
||||||
passed_guard: bool,
|
passed_guard: bool,
|
||||||
) -> None: ...
|
) -> None:
|
||||||
|
...
|
||||||
|
|
||||||
|
|
||||||
class QLearningPromptSelector(PromptSelectionInterface):
|
class QLearningPromptSelector(PromptSelectionInterface):
|
||||||
|
|||||||
Reference in new issue
Block a user