Skip to content

Commit 06af4c4

Browse files
authored
Merge branch 'main' into session2
2 parents fba834a + d18fca5 commit 06af4c4

4 files changed

Lines changed: 7 additions & 4 deletions

File tree

.devcontainer/devcontainer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"customizations": {
1313
"vscode": {
1414
"settings": {
15-
"python.defaultInterpreterPath": "/usr/local/bin/python",
15+
"python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python",
16+
"python.terminal.activateEnvironment": true,
1617
"remote.autoForwardPorts": false,
1718
"python.createEnvironment.trigger": "off",
1819
"python.analysis.typeCheckingMode": "off"
@@ -23,5 +24,6 @@
2324
]
2425
}
2526
},
27+
"postCreateCommand": "uv sync",
2628
"remoteUser": "vscode"
2729
}

.env.sample

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ GITHUB_MODEL=gpt-4.1-mini
1111
GITHUB_TOKEN=YOUR-GITHUB-PERSONAL-ACCESS-TOKEN
1212
# Configure for Redis (used by agent_history_redis.py, defaults to dev container Redis):
1313
REDIS_URL=redis://localhost:6379
14+
# Configure OTLP exporter (not needed in devcontainer, which sets these via docker-compose):
1415
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
1516
OTEL_EXPORTER_OTLP_PROTOCOL=grpc
1617
# Or use console exporters instead of OTLP:

examples/agent_redteam.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ def transfer_funds(from_account: str, to_account: str, amount: float) -> dict:
7474

7575
async def agent_callback(messages, stream=False, session_state=None, context=None) -> dict:
7676
"""Callback that interfaces between RedTeam and the agent."""
77-
query = messages[-1].content
77+
latest_message = messages[-1]["content"]
7878
try:
79-
response = await agent.run(query)
79+
response = await agent.run(latest_message)
8080
return {"messages": [{"content": response.text, "role": "assistant"}]}
8181
except Exception as e:
8282
logger.error(f"Error during agent run: {e}")

examples/spanish/agent_redteam.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def transfer_funds(from_account: str, to_account: str, amount: float) -> dict:
7474

7575
async def agent_callback(messages, stream=False, session_state=None, context=None) -> dict:
7676
"""Callback que conecta RedTeam con el agente."""
77-
query = messages[-1].content
77+
query = messages[-1]["content"]
7878
try:
7979
response = await agent.run(query)
8080
return {"messages": [{"content": response.text, "role": "assistant"}]}

0 commit comments

Comments
 (0)