mirror of
https://github.com/msoedov/agentic_security.git
synced 2026-10-11 16:48:53 +02:00
fix(mcp server):
This commit is contained in:
1 parent
f9dce3f915
commit
56984c7078
3 files changed
+5
-6
No files matched your search
@@ -66,7 +66,7 @@ class Module:
|
|||||||
return {}
|
return {}
|
||||||
|
|
||||||
async def fetch_prompts(self) -> list[str]:
|
async def fetch_prompts(self) -> list[str]:
|
||||||
api_url = "https://edge.metaheuristic.co/infer"
|
api_url = "https://mcp.metaheuristic.co/infer"
|
||||||
headers = {
|
headers = {
|
||||||
"Authorization": f"Bearer {AUTH_TOKEN}",
|
"Authorization": f"Bearer {AUTH_TOKEN}",
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
|
|||||||
@@ -121,8 +121,7 @@ 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):
|
||||||
@@ -216,7 +215,7 @@ class Module:
|
|||||||
self.run_id = U.uuid4().hex
|
self.run_id = U.uuid4().hex
|
||||||
self.batch_size = self.opts.get("batch_size", 500)
|
self.batch_size = self.opts.get("batch_size", 500)
|
||||||
self.rl_model = CloudRLPromptSelector(
|
self.rl_model = CloudRLPromptSelector(
|
||||||
prompt_groups, "https://edge.metaheuristic.co", run_id=self.run_id
|
prompt_groups, "https://mcp.metaheuristic.co", run_id=self.run_id
|
||||||
)
|
)
|
||||||
|
|
||||||
async def apply(self):
|
async def apply(self):
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ def mock_requests() -> Mock:
|
|||||||
def mock_rl_selector() -> Mock:
|
def mock_rl_selector() -> Mock:
|
||||||
return CloudRLPromptSelector(
|
return CloudRLPromptSelector(
|
||||||
dataset_prompts,
|
dataset_prompts,
|
||||||
api_url="https://edge.metaheuristic.co",
|
api_url="https://mcp.metaheuristic.co",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@ class TestCloudRLPromptSelector:
|
|||||||
def test_select_next_prompt_success_service(self, dataset_prompts):
|
def test_select_next_prompt_success_service(self, dataset_prompts):
|
||||||
selector = CloudRLPromptSelector(
|
selector = CloudRLPromptSelector(
|
||||||
dataset_prompts,
|
dataset_prompts,
|
||||||
api_url="https://edge.metaheuristic.co",
|
api_url="https://mcp.metaheuristic.co",
|
||||||
)
|
)
|
||||||
next_prompt = selector.select_next_prompt(
|
next_prompt = selector.select_next_prompt(
|
||||||
"How does RL work?", passed_guard=True
|
"How does RL work?", passed_guard=True
|
||||||
|
|||||||
Reference in new issue
Block a user