|
19 | 19 | }, |
20 | 20 | { |
21 | 21 | "cell_type": "code", |
22 | | - "execution_count": 1, |
| 22 | + "execution_count": null, |
23 | 23 | "metadata": {}, |
24 | 24 | "outputs": [], |
25 | 25 | "source": [ |
|
39 | 39 | }, |
40 | 40 | { |
41 | 41 | "cell_type": "code", |
42 | | - "execution_count": null, |
| 42 | + "execution_count": 2, |
43 | 43 | "metadata": {}, |
44 | 44 | "outputs": [], |
45 | 45 | "source": [ |
|
51 | 51 | }, |
52 | 52 | { |
53 | 53 | "cell_type": "code", |
54 | | - "execution_count": null, |
| 54 | + "execution_count": 3, |
55 | 55 | "metadata": {}, |
56 | | - "outputs": [], |
| 56 | + "outputs": [ |
| 57 | + { |
| 58 | + "data": { |
| 59 | + "text/html": [ |
| 60 | + "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">ValidationOutcome</span><span style=\"font-weight: bold\">(</span>\n", |
| 61 | + " <span style=\"color: #808000; text-decoration-color: #808000\">call_id</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'14148119808'</span>,\n", |
| 62 | + " <span style=\"color: #808000; text-decoration-color: #808000\">raw_llm_output</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'.'</span>,\n", |
| 63 | + " <span style=\"color: #808000; text-decoration-color: #808000\">validation_summaries</span>=<span style=\"font-weight: bold\">[]</span>,\n", |
| 64 | + " <span style=\"color: #808000; text-decoration-color: #808000\">validated_output</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'.'</span>,\n", |
| 65 | + " <span style=\"color: #808000; text-decoration-color: #808000\">reask</span>=<span style=\"color: #800080; text-decoration-color: #800080; font-style: italic\">None</span>,\n", |
| 66 | + " <span style=\"color: #808000; text-decoration-color: #808000\">validation_passed</span>=<span style=\"color: #00ff00; text-decoration-color: #00ff00; font-style: italic\">True</span>,\n", |
| 67 | + " <span style=\"color: #808000; text-decoration-color: #808000\">error</span>=<span style=\"color: #800080; text-decoration-color: #800080; font-style: italic\">None</span>\n", |
| 68 | + "<span style=\"font-weight: bold\">)</span>\n", |
| 69 | + "</pre>\n" |
| 70 | + ], |
| 71 | + "text/plain": [ |
| 72 | + "\u001b[1;35mValidationOutcome\u001b[0m\u001b[1m(\u001b[0m\n", |
| 73 | + " \u001b[33mcall_id\u001b[0m=\u001b[32m'14148119808'\u001b[0m,\n", |
| 74 | + " \u001b[33mraw_llm_output\u001b[0m=\u001b[32m'.'\u001b[0m,\n", |
| 75 | + " \u001b[33mvalidation_summaries\u001b[0m=\u001b[1m[\u001b[0m\u001b[1m]\u001b[0m,\n", |
| 76 | + " \u001b[33mvalidated_output\u001b[0m=\u001b[32m'.'\u001b[0m,\n", |
| 77 | + " \u001b[33mreask\u001b[0m=\u001b[3;35mNone\u001b[0m,\n", |
| 78 | + " \u001b[33mvalidation_passed\u001b[0m=\u001b[3;92mTrue\u001b[0m,\n", |
| 79 | + " \u001b[33merror\u001b[0m=\u001b[3;35mNone\u001b[0m\n", |
| 80 | + "\u001b[1m)\u001b[0m\n" |
| 81 | + ] |
| 82 | + }, |
| 83 | + "metadata": {}, |
| 84 | + "output_type": "display_data" |
| 85 | + } |
| 86 | + ], |
57 | 87 | "source": [ |
58 | 88 | "fragment_generator = guard(\n", |
59 | | - " litellm.completion,\n", |
60 | 89 | " model=\"gpt-4o\",\n", |
61 | 90 | " messages=[\n", |
62 | 91 | " {\"role\": \"system\", \"content\": \"You are a helpful assistant.\"},\n", |
|
116 | 145 | "guard = gd.Guard()\n", |
117 | 146 | "\n", |
118 | 147 | "fragment_generator = await guard(\n", |
119 | | - " litellm.completion,\n", |
120 | 148 | " model=\"gpt-3.5-turbo\",\n", |
121 | 149 | " messages=[\n", |
122 | 150 | " {\"role\": \"system\", \"content\": \"You are a helpful assistant.\"},\n", |
|
137 | 165 | ], |
138 | 166 | "metadata": { |
139 | 167 | "kernelspec": { |
140 | | - "display_name": ".venv", |
| 168 | + "display_name": "litellm", |
141 | 169 | "language": "python", |
142 | 170 | "name": "python3" |
143 | 171 | }, |
|
151 | 179 | "name": "python", |
152 | 180 | "nbconvert_exporter": "python", |
153 | 181 | "pygments_lexer": "ipython3", |
154 | | - "version": "3.11.8" |
| 182 | + "version": "3.12.3" |
155 | 183 | } |
156 | 184 | }, |
157 | 185 | "nbformat": 4, |
|
0 commit comments