Skip to content

Commit ad205f2

Browse files
🚀 enable advanced prompts with templates (jinja2 & native .format)
1 parent 0bf2363 commit ad205f2

File tree

11 files changed

+987
-55
lines changed

11 files changed

+987
-55
lines changed

examples/basic_test.ipynb

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"cells": [
33
{
44
"cell_type": "code",
5-
"execution_count": 2,
5+
"execution_count": 1,
66
"metadata": {},
77
"outputs": [],
88
"source": [
@@ -11,16 +11,16 @@
1111
},
1212
{
1313
"cell_type": "code",
14-
"execution_count": 4,
14+
"execution_count": 2,
1515
"metadata": {},
1616
"outputs": [
1717
{
1818
"data": {
1919
"text/plain": [
20-
"dict_keys(['helpfulness', 'accuracy', 'clarity', 'conciseness', 'relevance', 'safety', 'toxicity', 'code_quality', 'code_security', 'creativity', 'professionalism', 'educational_value', 'preference', 'appropriate', 'factual', 'medical_accuracy', 'legal_appropriateness'])"
20+
"dict_keys(['helpfulness', 'accuracy', 'clarity', 'conciseness', 'relevance', 'safety', 'toxicity', 'code_quality', 'code_security', 'creativity', 'professionalism', 'educational_value', 'preference', 'appropriate', 'factual', 'medical_accuracy', 'legal_appropriateness', 'educational_content_template', 'code_review_template', 'customer_service_template', 'writing_quality_template', 'product_review_template', 'medical_info_template', 'api_docs_template'])"
2121
]
2222
},
23-
"execution_count": 4,
23+
"execution_count": 2,
2424
"metadata": {},
2525
"output_type": "execute_result"
2626
}
@@ -31,16 +31,16 @@
3131
},
3232
{
3333
"cell_type": "code",
34-
"execution_count": 5,
34+
"execution_count": 3,
3535
"metadata": {},
3636
"outputs": [],
3737
"source": [
38-
"judge = Judge.from_url(base_url=\"http://localhost:8080\", model=\"qwen2\")"
38+
"judge = Judge.from_url(base_url=\"http://localhost:8080\")"
3939
]
4040
},
4141
{
4242
"cell_type": "code",
43-
"execution_count": null,
43+
"execution_count": 4,
4444
"metadata": {},
4545
"outputs": [],
4646
"source": [
@@ -50,7 +50,7 @@
5050
},
5151
{
5252
"cell_type": "code",
53-
"execution_count": 11,
53+
"execution_count": 5,
5454
"metadata": {},
5555
"outputs": [
5656
{
@@ -63,7 +63,7 @@
6363
" 'raw_response': '{\\n \"decision\": false,\\n \"reasoning\": \"The response lacks a professional tone and is informal. It uses casual language and lacks context or formal structure.\",\\n \"score\": null\\n}'}}"
6464
]
6565
},
66-
"execution_count": 11,
66+
"execution_count": 5,
6767
"metadata": {},
6868
"output_type": "execute_result"
6969
}
@@ -74,7 +74,7 @@
7474
},
7575
{
7676
"cell_type": "code",
77-
"execution_count": 12,
77+
"execution_count": 6,
7878
"metadata": {},
7979
"outputs": [
8080
{
@@ -87,7 +87,7 @@
8787
" 'raw_response': '{\\n \"decision\": 5,\\n \"reasoning\": \"The response lacks a formal and professional tone. It uses informal language and an interrogative form which is not typical in professional communication.\",\\n \"score\": 5\\n}'}}"
8888
]
8989
},
90-
"execution_count": 12,
90+
"execution_count": 6,
9191
"metadata": {},
9292
"output_type": "execute_result"
9393
}
@@ -101,7 +101,7 @@
101101
},
102102
{
103103
"cell_type": "code",
104-
"execution_count": 13,
104+
"execution_count": 7,
105105
"metadata": {},
106106
"outputs": [
107107
{
@@ -114,7 +114,7 @@
114114
" 'raw_response': '{\\n \"decision\": 5,\\n \"reasoning\": \"The response is somewhat direct and to the point, but lacks formality and context typically expected in a professional setting.\",\\n \"score\": 5\\n}'}}"
115115
]
116116
},
117-
"execution_count": 13,
117+
"execution_count": 7,
118118
"metadata": {},
119119
"output_type": "execute_result"
120120
}
@@ -132,7 +132,7 @@
132132
},
133133
{
134134
"cell_type": "code",
135-
"execution_count": 14,
135+
"execution_count": 8,
136136
"metadata": {},
137137
"outputs": [],
138138
"source": [
@@ -146,7 +146,7 @@
146146
},
147147
{
148148
"cell_type": "code",
149-
"execution_count": 15,
149+
"execution_count": 9,
150150
"metadata": {},
151151
"outputs": [
152152
{
@@ -159,7 +159,7 @@
159159
" 'raw_response': '{\\n \"decision\": \"moderate\",\\n \"reasoning\": \"The email lacks formal language and a clear request, which is more appropriate for a professional setting. It is direct but informal.\",\\n \"score\": 5\\n}'}}"
160160
]
161161
},
162-
"execution_count": 15,
162+
"execution_count": 9,
163163
"metadata": {},
164164
"output_type": "execute_result"
165165
}
@@ -172,20 +172,20 @@
172172
},
173173
{
174174
"cell_type": "code",
175-
"execution_count": null,
175+
"execution_count": 10,
176176
"metadata": {},
177177
"outputs": [
178178
{
179179
"data": {
180180
"text/plain": [
181181
"{'decision': 'non-professional',\n",
182-
" 'reasoning': 'The response lacks clarity and formality, which are key elements of a professional tone.',\n",
183-
" 'score': 4.0,\n",
182+
" 'reasoning': 'The response uses informal and expletive language, which is not appropriate for a professional context.',\n",
183+
" 'score': 1.0,\n",
184184
" 'metadata': {'model': 'qwen2',\n",
185-
" 'raw_response': '{\\n \"decision\": \"non-professional\",\\n \"reasoning\": \"The response lacks clarity and formality, which are key elements of a professional tone.\",\\n \"score\": 4\\n}'}}"
185+
" 'raw_response': '{\\n \"decision\": \"non-professional\",\\n \"reasoning\": \"The response uses informal and expletive language, which is not appropriate for a professional context.\",\\n \"score\": 1\\n}'}}"
186186
]
187187
},
188-
"execution_count": 17,
188+
"execution_count": 10,
189189
"metadata": {},
190190
"output_type": "execute_result"
191191
}

0 commit comments

Comments
 (0)