Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
244 changes: 243 additions & 1 deletion test/formatters/granite/test_intrinsics_formatters.py

Large diffs are not rendered by default.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"messages": [
{
"role": "assistant",
"content": "Hello there, welcome to math questions!"
},
{
"content": "What is the square root of 4?",
"role": "user"
},
{
"role": "assistant",
"content": "The square root of 4 is 2."
},
{
"content": "<requirements>: The user's question is not one of the homework questions given in the provided documents.\nPlease verify if the assistant's generation satisfies the user's requirements or not and reply with a binary label accordingly. Respond with a json {\"score\": \"yes\"} if the constraints are satisfied or respond with {\"score\": \"no\"} if the constraints are not satisfied.",
"role": "user"
}
],
"extra_body": {
"documents": [
{
"doc_id": "1",
"text": "\nHere's a list of math problems that are on the homework assignment:\n\n1) 12+5=17\n2) 20-8=12\n3) 6*7=42\n4) 45/9=5\n5) 13*2=26\n6) 99+11=110\n7) 100-35=65\n\n"
}
]
}
}
28 changes: 28 additions & 0 deletions test/formatters/granite/testdata/input_json/uncertainty.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"messages": [
{
"role": "assistant",
"content": "Welcome to pet questions!"
},
{
"role": "user",
"content": "Which of my pets have fleas?"
},
{
"role": "assistant",
"content": "Based on the documents, your dog has fleas but your cat does not."
}
],
"extra_body": {
"documents": [
{
"doc_id": "1",
"text": "My dog has fleas."
},
{
"doc_id": "2",
"text": "My cat does not have fleas."
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"messages": [
{
"content": "Hello there, welcome to math questions!",
"role": "assistant"
},
{
"content": "What is the square root of 4?",
"role": "user"
},
{
"content": "The square root of 4 is 2.",
"role": "assistant"
},
{
"content": "<requirements>: The user's question is not one of the homework questions given in the provided documents.\nPlease verify if the assistant's generation satisfies the user's requirements or not and reply with a binary label accordingly. Respond with a json {\"score\": \"yes\"} if the constraints are satisfied or respond with {\"score\": \"no\"} if the constraints are not satisfied.",
"role": "user"
}
],
"extra_body": {
"documents": [
{
"text": "\nHere's a list of math problems that are on the homework assignment:\n\n1) 12+5=17\n2) 20-8=12\n3) 6*7=42\n4) 45/9=5\n5) 13*2=26\n6) 99+11=110\n7) 100-35=65\n\n",
"doc_id": "1"
}
],
"structured_outputs": {
"json": {
"type": "object",
"properties": {
"score": {
"type": "string",
"enum": [
"yes",
"no"
]
}
},
"required": [
"score"
],
"additionalProperties": false
}
}
},
"max_completion_tokens": 15,
"temperature": 0.0,
"logprobs": true,
"top_logprobs": 10
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"messages": [
{
"content": "Welcome to pet questions!",
"role": "assistant"
},
{
"content": "Which of my pets have fleas?",
"role": "user"
},
{
"content": "Based on the documents, your dog has fleas but your cat does not.",
"role": "assistant"
}
],
"extra_body": {
"documents": [
{
"text": "My dog has fleas.",
"doc_id": "1"
},
{
"text": "My cat does not have fleas.",
"doc_id": "2"
}
],
"structured_outputs": {
"json": {
"type": "object",
"properties": {
"score": {
"type": "string",
"enum": [
"0",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9"
]
}
},
"required": [
"score"
],
"additionalProperties": false
}
}
},
"max_completion_tokens": 15,
"temperature": 0.0,
"logprobs": true,
"top_logprobs": 10
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"choices": [
{
"index": 0,
"message": {
"content": "{\"requirement_check\": {\"score\": 0.4206108287116171}}",
"role": "assistant"
}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"choices": [
{
"index": 0,
"message": {
"content": "{\"certainty\": 0.8550706654633036}",
"role": "assistant"
}
}
]
}
Loading
Loading