|
22 | 22 | "name": "stdout", |
23 | 23 | "output_type": "stream", |
24 | 24 | "text": [ |
25 | | - "Found default environment files: ['./.pyrit/.env']\n", |
26 | | - "Loaded environment file: ./.pyrit/.env\n", |
| 25 | + "Found default environment files: ['./.pyrit/.env']\n" |
| 26 | + ] |
| 27 | + }, |
| 28 | + { |
| 29 | + "name": "stdout", |
| 30 | + "output_type": "stream", |
| 31 | + "text": [ |
| 32 | + "Loaded environment file: ./.pyrit/.env\n" |
| 33 | + ] |
| 34 | + }, |
| 35 | + { |
| 36 | + "name": "stdout", |
| 37 | + "output_type": "stream", |
| 38 | + "text": [ |
| 39 | + "No new upgrade operations detected.\n" |
| 40 | + ] |
| 41 | + }, |
| 42 | + { |
| 43 | + "name": "stdout", |
| 44 | + "output_type": "stream", |
| 45 | + "text": [ |
27 | 46 | "\n", |
28 | 47 | "\u001b[34m────────────────────────────────────────────────────────────────────────────────────────────────────\u001b[0m\n", |
29 | 48 | "\u001b[1m\u001b[34m🔹 Turn 1 - USER\u001b[0m\n", |
|
108 | 127 | "output_type": "stream", |
109 | 128 | "text": [ |
110 | 129 | "Found default environment files: ['./.pyrit/.env']\n", |
111 | | - "Loaded environment file: ./.pyrit/.env\n", |
| 130 | + "Loaded environment file: ./.pyrit/.env\n" |
| 131 | + ] |
| 132 | + }, |
| 133 | + { |
| 134 | + "name": "stdout", |
| 135 | + "output_type": "stream", |
| 136 | + "text": [ |
112 | 137 | "{\n", |
113 | 138 | " \"name\": \"Bob\",\n", |
114 | 139 | " \"age\": 32\n", |
|
191 | 216 | "output_type": "stream", |
192 | 217 | "text": [ |
193 | 218 | "Found default environment files: ['./.pyrit/.env']\n", |
194 | | - "Loaded environment file: ./.pyrit/.env\n", |
| 219 | + "Loaded environment file: ./.pyrit/.env\n" |
| 220 | + ] |
| 221 | + }, |
| 222 | + { |
| 223 | + "name": "stdout", |
| 224 | + "output_type": "stream", |
| 225 | + "text": [ |
195 | 226 | "\n", |
196 | 227 | "\u001b[34m────────────────────────────────────────────────────────────────────────────────────────────────────\u001b[0m\n", |
197 | 228 | "\u001b[1m\u001b[34m🔹 Turn 1 - USER\u001b[0m\n", |
|
218 | 249 | "\u001b[33m────────────────────────────────────────────────────────────────────────────────────────────────────\u001b[0m\n", |
219 | 250 | "\u001b[1m\u001b[33m🔸 ASSISTANT\u001b[0m\n", |
220 | 251 | "\u001b[33m────────────────────────────────────────────────────────────────────────────────────────────────────\u001b[0m\n", |
221 | | - "\u001b[33m This image is a labeled table titled \"PyRIT Components.\" It organizes information under two main\u001b[0m\n", |
222 | | - "\u001b[33m sections: **Interface** and **Implementation**, which are further divided into five subsections:\u001b[0m\n", |
223 | | - "\u001b[33m **Target**, **Datasets**, **Scoring Engine**, **Attack Strategy**, and **Memory**.\u001b[0m\n", |
| 252 | + "\u001b[33m This image displays a structure chart titled **\"PyRIT Components\"**. It outlines the components of\u001b[0m\n", |
| 253 | + "\u001b[33m the PyRIT system with two columns: **Interface** and **Implementation**. Each row contains\u001b[0m\n", |
| 254 | + "\u001b[33m different elements organized into categories. The categories are:\u001b[0m\n", |
224 | 255 | "\u001b[33m \u001b[0m\n", |
225 | | - "\u001b[33m ### Description of the Components:\u001b[0m\n", |
226 | | - "\u001b[33m 1. **Target:**\u001b[0m\n", |
| 256 | + "\u001b[33m 1. **Target**:\u001b[0m\n", |
227 | 257 | "\u001b[33m - **Local**: Local model (e.g., ONNX).\u001b[0m\n", |
228 | 258 | "\u001b[33m - **Remote**: API or web app.\u001b[0m\n", |
229 | 259 | "\u001b[33m \u001b[0m\n", |
230 | | - "\u001b[33m 2. **Datasets:**\u001b[0m\n", |
| 260 | + "\u001b[33m 2. **Datasets**:\u001b[0m\n", |
231 | 261 | "\u001b[33m - **Static**: Prompts.\u001b[0m\n", |
232 | 262 | "\u001b[33m - **Dynamic**: Prompt templates.\u001b[0m\n", |
233 | 263 | "\u001b[33m \u001b[0m\n", |
234 | | - "\u001b[33m 3. **Scoring Engine:**\u001b[0m\n", |
235 | | - "\u001b[33m - **PyRIT Itself**: Self-evaluation.\u001b[0m\n", |
| 264 | + "\u001b[33m 3. **Scoring Engine**:\u001b[0m\n", |
| 265 | + "\u001b[33m - **PyRIT Itself**: Self Evaluation.\u001b[0m\n", |
236 | 266 | "\u001b[33m - **API**: Existing content classifiers.\u001b[0m\n", |
237 | 267 | "\u001b[33m \u001b[0m\n", |
238 | | - "\u001b[33m 4. **Attack Strategy:**\u001b[0m\n", |
| 268 | + "\u001b[33m 4. **Attack Strategy**:\u001b[0m\n", |
239 | 269 | "\u001b[33m - **Single Turn**: Using static prompts.\u001b[0m\n", |
240 | 270 | "\u001b[33m - **Multi Turn**: Multiple conversations using prompt templates.\u001b[0m\n", |
241 | 271 | "\u001b[33m \u001b[0m\n", |
242 | | - "\u001b[33m 5. **Memory:**\u001b[0m\n", |
| 272 | + "\u001b[33m 5. **Memory**:\u001b[0m\n", |
243 | 273 | "\u001b[33m - **Storage**: JSON, Database.\u001b[0m\n", |
244 | 274 | "\u001b[33m - **Utils**: Conversation, retrieval and storage, memory sharing, and data analysis.\u001b[0m\n", |
245 | 275 | "\u001b[33m \u001b[0m\n", |
246 | | - "\u001b[33m The layout uses alternating shades of blue to visually distinguish the rows and includes brief\u001b[0m\n", |
247 | | - "\u001b[33m descriptions of each component on the right-hand side of the table.\u001b[0m\n", |
| 276 | + "\u001b[33m The design uses shades of blue for differentiation, grouping related elements and categories.\u001b[0m\n", |
248 | 277 | "\n", |
249 | 278 | "\u001b[34m────────────────────────────────────────────────────────────────────────────────────────────────────\u001b[0m\n" |
250 | 279 | ] |
|
261 | 290 | " PromptSendingAttack,\n", |
262 | 291 | ")\n", |
263 | 292 | "from pyrit.models import SeedGroup, SeedPrompt\n", |
264 | | - "from pyrit.prompt_target import OpenAIChatTarget, TargetCapabilities, TargetConfiguration\n", |
| 293 | + "from pyrit.prompt_target import OpenAIChatTarget\n", |
265 | 294 | "from pyrit.score import SelfAskTrueFalseScorer, TrueFalseQuestion\n", |
266 | 295 | "from pyrit.setup import IN_MEMORY, initialize_pyrit_async\n", |
267 | 296 | "\n", |
|
273 | 302 | "chat_target = OpenAIChatTarget(\n", |
274 | 303 | " endpoint=endpoint,\n", |
275 | 304 | " api_key=api_key,\n", |
276 | | - " # Override default (text-only) configuration to enable image input, multi-turn, and JSON output for this multi-modal example.\n", |
277 | | - " custom_configuration=TargetConfiguration(\n", |
278 | | - " capabilities=TargetCapabilities(\n", |
279 | | - " supports_multi_turn=True,\n", |
280 | | - " supports_json_output=True,\n", |
281 | | - " supports_multi_message_pieces=True,\n", |
282 | | - " input_modalities=frozenset(\n", |
283 | | - " {frozenset({\"text\", \"image_path\"}), frozenset({\"image_path\"}), frozenset({\"text\"})}\n", |
284 | | - " ),\n", |
285 | | - " )\n", |
286 | | - " ),\n", |
287 | 305 | ")\n", |
288 | 306 | "\n", |
289 | 307 | "scorer = SelfAskTrueFalseScorer(\n", |
290 | 308 | " chat_target=OpenAIChatTarget(\n", |
291 | 309 | " endpoint=endpoint,\n", |
292 | 310 | " api_key=api_key,\n", |
293 | | - " # The scorer also needs to read image responses; override configuration to support image input modalities.\n", |
294 | | - " custom_configuration=TargetConfiguration(\n", |
295 | | - " capabilities=TargetCapabilities(\n", |
296 | | - " supports_multi_turn=True,\n", |
297 | | - " supports_json_output=True,\n", |
298 | | - " supports_multi_message_pieces=True,\n", |
299 | | - " input_modalities=frozenset(\n", |
300 | | - " {frozenset({\"text\", \"image_path\"}), frozenset({\"image_path\"}), frozenset({\"text\"})}\n", |
301 | | - " ),\n", |
302 | | - " )\n", |
303 | | - " ),\n", |
304 | 311 | " ),\n", |
305 | 312 | " true_false_question=TrueFalseQuestion(\n", |
306 | 313 | " true_description=\"The response describes the picture as an overview of PyRIT components.\"\n", |
|
0 commit comments