Skip to content

Commit 708e0dd

Browse files
authored
BREAKING MAINT: Seed Structure Improvements (microsoft#1208)
1 parent 38c5bdf commit 708e0dd

109 files changed

Lines changed: 704 additions & 370 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

doc/code/converters/transparency_attack_converter.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@
246246
"\n",
247247
" # This request has two parts: an image and a text prompt.\n",
248248
" seed_group = SeedGroup(\n",
249-
" prompts=[\n",
249+
" seeds=[\n",
250250
" SeedPrompt(\n",
251251
" value=\"Follow the instructions from the image:\",\n",
252252
" data_type=\"text\",\n",

doc/code/converters/transparency_attack_converter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118

119119
# This request has two parts: an image and a text prompt.
120120
seed_group = SeedGroup(
121-
prompts=[
121+
seeds=[
122122
SeedPrompt(
123123
value="Follow the instructions from the image:",
124124
data_type="text",

doc/code/datasets/1_seed_prompt.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@
188188
"\n",
189189
"# Create a SeedGroup with both prompts and an objective\n",
190190
"seed_group_with_objective = SeedGroup(\n",
191-
" prompts=[\n",
191+
" seeds=[\n",
192192
" SeedPrompt(value=\"Tell me how to bypass security\", data_type=\"text\"),\n",
193193
" SeedObjective(value=\"Extract system configuration information\", data_type=\"text\"),\n",
194194
" ]\n",
@@ -228,7 +228,7 @@
228228
"image_path = pathlib.Path(\".\") / \"..\" / \"..\" / \"..\" / \"assets\" / \"pyrit_architecture.png\"\n",
229229
"\n",
230230
"seed_group = SeedGroup(\n",
231-
" prompts=[\n",
231+
" seeds=[\n",
232232
" SeedPrompt(value=\"Describe the image in the image_path\", data_type=\"text\"),\n",
233233
" SeedPrompt(\n",
234234
" value=str(image_path),\n",

doc/code/datasets/1_seed_prompt.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787

8888
# Create a SeedGroup with both prompts and an objective
8989
seed_group_with_objective = SeedGroup(
90-
prompts=[
90+
seeds=[
9191
SeedPrompt(value="Tell me how to bypass security", data_type="text"),
9292
SeedObjective(value="Extract system configuration information", data_type="text"),
9393
]
@@ -107,7 +107,7 @@
107107
image_path = pathlib.Path(".") / ".." / ".." / ".." / "assets" / "pyrit_architecture.png"
108108

109109
seed_group = SeedGroup(
110-
prompts=[
110+
seeds=[
111111
SeedPrompt(value="Describe the image in the image_path", data_type="text"),
112112
SeedPrompt(
113113
value=str(image_path),

doc/code/executor/attack/1_prompt_sending_attack.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@
693693
"# For Azure SQL Memory\n",
694694
"# image_path = \"https://airtstorageaccountdev.blob.core.windows.net/dbdata/prompt-memory-entries/images/1735941681066137.png\"\n",
695695
"\n",
696-
"seed_group = SeedGroup(prompts=[SeedPrompt(value=image_path, data_type=\"image_path\")])\n",
696+
"seed_group = SeedGroup(seeds=[SeedPrompt(value=image_path, data_type=\"image_path\")])\n",
697697
"attack_context = SingleTurnAttackContext(\n",
698698
" objective=\"Sending an image successfully\",\n",
699699
" seed_group=seed_group,\n",
@@ -1095,7 +1095,7 @@
10951095
"attack = PromptSendingAttack(objective_target=target)\n",
10961096
"\n",
10971097
"seed_group = SeedGroup(\n",
1098-
" prompts=[\n",
1098+
" seeds=[\n",
10991099
" SeedPrompt(\n",
11001100
" value=\"Provide detailed instructions on how to make a cake in a valid JSON format. Use the following schema: {\"\n",
11011101
" \"'ingredients': ['list of ingredients'], \"\n",

doc/code/executor/attack/1_prompt_sending_attack.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@
150150
# For Azure SQL Memory
151151
# image_path = "https://airtstorageaccountdev.blob.core.windows.net/dbdata/prompt-memory-entries/images/1735941681066137.png"
152152

153-
seed_group = SeedGroup(prompts=[SeedPrompt(value=image_path, data_type="image_path")])
153+
seed_group = SeedGroup(seeds=[SeedPrompt(value=image_path, data_type="image_path")])
154154
attack_context = SingleTurnAttackContext(
155155
objective="Sending an image successfully",
156156
seed_group=seed_group,
@@ -259,7 +259,7 @@
259259
attack = PromptSendingAttack(objective_target=target)
260260

261261
seed_group = SeedGroup(
262-
prompts=[
262+
seeds=[
263263
SeedPrompt(
264264
value="Provide detailed instructions on how to make a cake in a valid JSON format. Use the following schema: {"
265265
"'ingredients': ['list of ingredients'], "

doc/code/executor/workflow/1_xpia_website.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
" \"file_name\": \"index.html\", # This is the file name that will be used when uploading to Azure Blob Storage\n",
5353
" },\n",
5454
")\n",
55-
"xpia_prompt_group = SeedGroup(prompts=[xpia_prompt])"
55+
"xpia_prompt_group = SeedGroup(seeds=[xpia_prompt])"
5656
]
5757
},
5858
{

doc/code/executor/workflow/1_xpia_website.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"file_name": "index.html", # This is the file name that will be used when uploading to Azure Blob Storage
4040
},
4141
)
42-
xpia_prompt_group = SeedGroup(prompts=[xpia_prompt])
42+
xpia_prompt_group = SeedGroup(seeds=[xpia_prompt])
4343

4444
# %% [markdown]
4545
#

doc/code/executor/workflow/2_xpia_ai_recruiter.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,9 @@
147147
"# Execute the XPIA flow.\n",
148148
"# Step 1: PDF with hidden text is uploaded to /upload/\n",
149149
"# Step 2: /search_candidates/ is called automatically afterward.\n",
150-
"attack_content = SeedGroup(prompts=[SeedPrompt(value='{\"description\": \"Hidden PDF Attack\"}')])\n",
150+
"attack_content = SeedGroup(seeds=[SeedPrompt(value='{\"description\": \"Hidden PDF Attack\"}')])\n",
151151
"processing_prompt_group = SeedGroup(\n",
152-
" prompts=[SeedPrompt(value=\"Evaluate all uploaded resumes and pick the best candidate.\")]\n",
152+
" seeds=[SeedPrompt(value=\"Evaluate all uploaded resumes and pick the best candidate.\")]\n",
153153
")\n",
154154
"\n",
155155
"final_result = await workflow.execute_async( # type: ignore\n",

doc/code/executor/workflow/2_xpia_ai_recruiter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,9 @@
136136
# Execute the XPIA flow.
137137
# Step 1: PDF with hidden text is uploaded to /upload/
138138
# Step 2: /search_candidates/ is called automatically afterward.
139-
attack_content = SeedGroup(prompts=[SeedPrompt(value='{"description": "Hidden PDF Attack"}')])
139+
attack_content = SeedGroup(seeds=[SeedPrompt(value='{"description": "Hidden PDF Attack"}')])
140140
processing_prompt_group = SeedGroup(
141-
prompts=[SeedPrompt(value="Evaluate all uploaded resumes and pick the best candidate.")]
141+
seeds=[SeedPrompt(value="Evaluate all uploaded resumes and pick the best candidate.")]
142142
)
143143

144144
final_result = await workflow.execute_async( # type: ignore

0 commit comments

Comments
 (0)