Add skelethon for first example

Signed-off-by: Víctor Mayoral Vilches <v.mayoralv@gmail.com>
This commit is contained in:
Víctor Mayoral Vilches 2025-01-09 14:29:28 +01:00
parent cbc064d1ae
commit 120345240b
3 changed files with 44 additions and 1 deletions

View File

@ -1,4 +1,4 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
doc// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.241.1/containers/python-3
{
"name": "exploitflow_devenv",

View File

@ -0,0 +1,42 @@
from cai import CAI, Agent
import pentestperf as ptt
client = CAI()
english_agent = Agent(
model="qwen2.5:14b",
name="A file listing tool",
instructions="You only speak English. If another language is detected, invoke transfer_to_spanish_agent.",
# instructions="You only speak English.",
# tool_choice="required", # not working with ollama and qwen2.5
)
spanish_agent = Agent(
name="Spanish Agent",
instructions="You only speak Spanish.",
)
def transfer_to_spanish_agent():
"""Transfer spanish speaking users immediately."""
return spanish_agent
english_agent.functions.append(transfer_to_spanish_agent)
messages = [{"role": "user", "content": "Hola, cómo estás?"}]
response = client.run(agent=english_agent, messages=messages, debug=True)
print(response.messages[-1]["content"])
# # PentestPerf setup for "picoctf_static_flag"
# ctf = ptt.ctf(
# "picoctf_static_flag",
# subnet="192.168.9.0/24",
# container_name="ancient",
# ip_address="192.168.9.52",
# )
# ctf.start_ctf()
# flag = ctf.get_flag()
# ctf.stop_ctf()

View File

@ -19,6 +19,7 @@ install_requires =
tqdm
pre-commit
instructor
pentestperf @ git+https://gitlab:gldt-1NfZ2XRWdHNip4K45auL@gitlab.com/aliasrobotics/alias_research/pentestperf@main
python_requires = >=3.10
[tool.autopep8]