Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eval qr json lines now has context from both turns and category if it exists #38199

Merged
merged 65 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
7de6367
Update task_query_response.prompty
nagkumar91 Oct 1, 2024
f288b34
Update task_simulate.prompty
nagkumar91 Oct 1, 2024
2a4b6f7
Update task_query_response.prompty
nagkumar91 Oct 2, 2024
c8ce251
Update task_simulate.prompty
nagkumar91 Oct 2, 2024
4522ae4
Merge branch 'Azure:main' into main
nagkumar91 Oct 3, 2024
32e9c1d
Merge branch 'Azure:main' into main
nagkumar91 Oct 7, 2024
76df69d
Merge branch 'Azure:main' into main
nagkumar91 Oct 8, 2024
aeddcb4
Merge branch 'Azure:main' into main
nagkumar91 Oct 8, 2024
65a759c
Merge branch 'Azure:main' into main
nagkumar91 Oct 9, 2024
e4cdd30
Fix the api_key needed
Oct 9, 2024
e3ab026
Merge branch 'Azure:main' into main
nagkumar91 Oct 11, 2024
4fb09c4
Merge branch 'Azure:main' into main
nagkumar91 Oct 15, 2024
e71a52d
Merge branch 'Azure:main' into main
nagkumar91 Oct 15, 2024
87166b3
Merge branch 'Azure:main' into main
nagkumar91 Oct 16, 2024
b478651
Update for release
nagkumar91 Oct 16, 2024
8e5a264
Black fix for file
nagkumar91 Oct 16, 2024
2077d6d
Merge branch 'Azure:main' into main
nagkumar91 Oct 17, 2024
3ab59c8
Merge branch 'Azure:main' into main
nagkumar91 Oct 17, 2024
3a80606
Add original text in global context
Oct 17, 2024
6768f9a
Update test
Oct 17, 2024
f7cc4bb
Update the indirect attack simulator
Oct 18, 2024
07eb466
Black suggested fixes
Oct 18, 2024
942bfd5
Update simulator prompty
Oct 18, 2024
2d4c376
Merge branch 'main' into main
nagkumar91 Oct 18, 2024
98cad97
Update adversarial scenario enum to exclude XPIA
Oct 18, 2024
d510316
Update changelog
Oct 18, 2024
742943e
Black fixes
Oct 18, 2024
12e0615
Remove duplicate import
Oct 18, 2024
de32b50
Fix the mypy error
Oct 19, 2024
4b64132
Mypy please be happy
Oct 21, 2024
1c0b4dd
Updates to non adv simulator
Oct 22, 2024
c4f9111
Merge branch 'Azure:main' into main
nagkumar91 Oct 22, 2024
6de617c
accept context from assistant messages, exclude them when using them …
Oct 23, 2024
1e5d40c
update changelog
Oct 23, 2024
93b29c7
pylint fixes
Oct 23, 2024
8e3ddc3
pylint fixes
Oct 23, 2024
31e0d29
Merge branch 'main' into main
nagkumar91 Oct 23, 2024
4ccc7c8
remove redundant quotes
Oct 23, 2024
bed5196
Fix typo
Oct 23, 2024
0fdd644
pylint fix
Oct 23, 2024
1f695cc
Update broken tests
Oct 23, 2024
3da3a94
Merge branch 'main' into main
nagkumar91 Oct 23, 2024
56c2657
Merge branch 'Azure:main' into main
nagkumar91 Oct 23, 2024
b04b3e6
Merge branch 'Azure:main' into main
nagkumar91 Oct 24, 2024
b9793ca
Merge branch 'Azure:main' into main
nagkumar91 Oct 25, 2024
92c9a6d
Include the grounding json in the manifest
Oct 25, 2024
0673cd5
Fix typo
Oct 25, 2024
7b360fc
Come on package
Oct 25, 2024
e3fd2bb
Merge branch 'Azure:main' into main
nagkumar91 Oct 28, 2024
c9f38c9
Release 1.0.0b5
Oct 28, 2024
bbb78fd
Merge branch 'main' of https://github.com/nagkumar91/azure-sdk-for-py…
Oct 28, 2024
ed7eed1
Notice from Chang
Oct 28, 2024
103f397
Merge branch 'Azure:main' into main
nagkumar91 Oct 28, 2024
3de5b66
Remove adv_conv template parameters from the outputs
Oct 28, 2024
21e3551
Merge branch 'main' of https://github.com/nagkumar91/azure-sdk-for-py…
Oct 28, 2024
78df8c9
Merge branch 'Azure:main' into main
nagkumar91 Oct 28, 2024
2b693bc
Merge branch 'Azure:main' into main
nagkumar91 Oct 29, 2024
f2e95d1
Update chanagelog
Oct 29, 2024
20b6d47
Merge branch 'Azure:main' into main
nagkumar91 Oct 29, 2024
a920c28
Merge branch 'main' of https://github.com/nagkumar91/azure-sdk-for-py…
Oct 29, 2024
f9ac10c
Experimental tags on adv scenarios
Oct 29, 2024
b570a51
Merge branch 'Azure:main' into main
nagkumar91 Oct 30, 2024
6c81cbb
Readme fix onbreaking change
Oct 30, 2024
b48f8ab
Add the category and both user and assistant context to the response …
Oct 30, 2024
d422e05
Update changelog
Oct 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sdk/evaluation/azure-ai-evaluation/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
### Breaking Changes

### Bugs Fixed
- Output of adversarial simulators are of type `JsonLineList` and the helper function `to_eval_qr_json_lines` now outputs context from both user and assistant turns along with `category` if it exists in the conversation

### Other Changes
- Refined error messages for serviced-based evaluators and simulators.
Expand Down
2 changes: 1 addition & 1 deletion sdk/evaluation/azure-ai-evaluation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ outputs = asyncio.run(
)
)

print(outputs.to_eval_qa_json_lines())
print(outputs.to_eval_qr_json_lines())
```
#### Direct Attack Simulator

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,41 @@ def to_eval_qr_json_lines(self):
for item in self:
user_message = None
assistant_message = None
context = None
user_context = None
assistant_context = None
template_parameters = item.get("template_parameters", {})
category = template_parameters.get("category", None)
for message in item["messages"]:
if message["role"] == "user":
user_message = message["content"]
user_context = message.get("context", "")
elif message["role"] == "assistant":
assistant_message = message["content"]
if "context" in message:
context = message.get("context", None)
assistant_context = message.get("context", "")
if user_message and assistant_message:
if context:
if user_context or assistant_context:
json_lines += (
json.dumps({"query": user_message, "response": assistant_message, "context": context})
json.dumps(
{
"query": user_message,
"response": assistant_message,
"context": str(
{
"user_context": user_context,
"assistant_context": assistant_context,
}
),
"category": category,
}
)
+ "\n"
)
user_message = assistant_message = context = None
user_message = assistant_message = None
else:
json_lines += json.dumps({"query": user_message, "response": assistant_message}) + "\n"
json_lines += (
json.dumps({"query": user_message, "response": assistant_message, "category": category})
+ "\n"
)
user_message = assistant_message = None

return json_lines
Expand Down
Loading