You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Update task_query_response.prompty
remove required keys
* Update task_simulate.prompty
* Update task_query_response.prompty
* Update task_simulate.prompty
* Fix the api_key needed
* Update for release
* Black fix for file
* Add original text in global context
* Update test
* Update the indirect attack simulator
* Black suggested fixes
* Update simulator prompty
* Update adversarial scenario enum to exclude XPIA
* Update changelog
* Black fixes
* Remove duplicate import
* Fix the mypy error
* Mypy please be happy
* Updates to non adv simulator
* accept context from assistant messages, exclude them when using them for conversation
* update changelog
* pylint fixes
* pylint fixes
* remove redundant quotes
* Fix typo
* pylint fix
* Update broken tests
* Include the grounding json in the manifest
* Fix typo
* Come on package
* Release 1.0.0b5
* Notice from Chang
* Remove adv_conv template parameters from the outputs
* Update chanagelog
* Experimental tags on adv scenarios
* Readme fix onbreaking change
* Add the category and both user and assistant context to the response of qr_json_lines
* Update changelog
* Rename _kwargs to _options
* _options as prefix
* update troubleshooting for simulator
* Rename according to suggestions
* Clean up readme
* more links
---------
Co-authored-by: Nagkumar Arkalgud <[email protected]>
Co-authored-by: Nagkumar Arkalgud <[email protected]>
Co-authored-by: Nagkumar Arkalgud <[email protected]>
@@ -180,292 +180,68 @@ For more details refer to [Evaluate on a target][evaluate_target]
180
180
### Simulator
181
181
182
182
183
-
Simulators allow users to generate synthentic data using their application. Simulator expects the user to have a callback method that invokes
184
-
their AI application.
185
-
186
-
#### Simulating with a Prompty
187
-
188
-
```yaml
189
-
---
190
-
name: ApplicationPrompty
191
-
description: Simulates an application
192
-
model:
193
-
api: chat
194
-
parameters:
195
-
temperature: 0.0
196
-
top_p: 1.0
197
-
presence_penalty: 0
198
-
frequency_penalty: 0
199
-
response_format:
200
-
type: text
201
-
202
-
inputs:
203
-
conversation_history:
204
-
type: dict
205
-
206
-
---
207
-
system:
208
-
You are a helpful assistant and you're helping with the user's query. Keep the conversation engaging and interesting.
209
-
210
-
Output with a string that continues the conversation, responding to the latest message from the user, given the conversation history:
211
-
{{ conversation_history }}
183
+
Simulators allow users to generate synthentic data using their application. Simulator expects the user to have a callback method that invokes their AI application. The intergration between your AI application and the simulator happens at the callback method. Here's how a sample callback would look like:
212
184
213
-
```
214
-
215
-
Query Response generaing prompty for gpt-4o with `json_schema` support
216
-
Use this file as an override.
217
-
```yaml
218
-
---
219
-
name: TaskSimulatorQueryResponseGPT4o
220
-
description: Gets queries and responses from a blob of text
221
-
model:
222
-
api: chat
223
-
parameters:
224
-
temperature: 0.0
225
-
top_p: 1.0
226
-
presence_penalty: 0
227
-
frequency_penalty: 0
228
-
response_format:
229
-
type: json_schema
230
-
json_schema:
231
-
name: QRJsonSchema
232
-
schema:
233
-
type: object
234
-
properties:
235
-
items:
236
-
type: array
237
-
items:
238
-
type: object
239
-
properties:
240
-
q:
241
-
type: string
242
-
r:
243
-
type: string
244
-
required:
245
-
- q
246
-
- r
247
-
248
-
inputs:
249
-
text:
250
-
type: string
251
-
num_queries:
252
-
type: integer
253
-
254
-
255
-
---
256
-
system:
257
-
You're an AI that helps in preparing a Question/Answer quiz from Text for "Who wants to be a millionaire" tv show
258
-
Both Questions and Answers MUST BE extracted from given Text
259
-
Frame Question in a way so that Answer is RELEVANT SHORT BITE-SIZED info from Text
260
-
RELEVANT info could be: NUMBER, DATE, STATISTIC, MONEY, NAME
261
-
A sentence should contribute multiple QnAs if it has more info in it
262
-
Answer must not be more than 5 words
263
-
Answer must be picked from Text as is
264
-
Question should be as descriptive as possible and must include as much context as possible from Text
265
-
Output must always have the provided number of QnAs
266
-
Output must be in JSON format.
267
-
Output must have {{num_queries}} objects in the format specified below. Any other count is unacceptable.
268
-
Text:
269
-
<|text_start|>
270
-
On January 24, 1984, former Apple CEO Steve Jobs introduced the first Macintosh. In late 2003, Apple had 2.06 percent of the desktop share in the United States.
271
-
Some years later, research firms IDC and Gartner reported that Apple's market share in the U.S. had increased to about 6%.
272
-
<|text_end|>
273
-
Output with 5 QnAs:
274
-
{
275
-
"qna": [{
276
-
"q": "When did the former Apple CEO Steve Jobs introduced the first Macintosh?",
277
-
"r": "January 24, 1984"
278
-
},
279
-
{
280
-
"q": "Who was the former Apple CEO that introduced the first Macintosh on January 24, 1984?",
281
-
"r": "Steve Jobs"
282
-
},
283
-
{
284
-
"q": "What percent of the desktop share did Apple have in the United States in late 2003?",
285
-
"r": "2.06 percent"
286
-
},
287
-
{
288
-
"q": "What were the research firms that reported on Apple's market share in the U.S.?",
289
-
"r": "IDC and Gartner"
290
-
},
291
-
{
292
-
"q": "What was the percentage increase of Apple's market share in the U.S., as reported by research firms IDC and Gartner?",
293
-
"r": "6%"
294
-
}]
295
-
}
296
-
Text:
297
-
<|text_start|>
298
-
{{ text }}
299
-
<|text_end|>
300
-
Output with {{ num_queries }} QnAs:
301
-
```
302
-
303
-
Application code:
304
185
305
186
```python
306
-
import json
307
-
import asyncio
308
-
from typing import Any, Dict, List, Optional
309
-
from azure.ai.evaluation.simulator import Simulator
310
-
from promptflow.client import load_flow
311
-
import os
312
-
import wikipedia
313
-
314
-
# Set up the model configuration without api_key, using DefaultAzureCredential
0 commit comments