|
17 | 17 | "\n", |
18 | 18 | "This notebook demonstrates how the AutoGen Agents can be integrated with Azure OpenAI to answer questions from the database based on the schemas provided. \n", |
19 | 19 | "\n", |
20 | | - "A multi-shot approach is used for SQL generation for more reliable results and reduced token usage. More details can be found in the README.md." |
| 20 | + "A multi-shot approach is used for SQL generation for more reliable results and reduced token usage. More details can be found in the README.md.\n", |
| 21 | + "\n", |
| 22 | + "To install dependencies:\n", |
| 23 | + "\n", |
| 24 | + "`uv sync --package autogen`" |
21 | 25 | ] |
22 | 26 | }, |
23 | 27 | { |
24 | 28 | "cell_type": "code", |
25 | 29 | "execution_count": null, |
26 | 30 | "metadata": {}, |
27 | | - "outputs": [], |
| 31 | + "outputs": [ |
| 32 | + { |
| 33 | + "ename": "", |
| 34 | + "evalue": "", |
| 35 | + "output_type": "error", |
| 36 | + "traceback": [ |
| 37 | + "\u001b[1;31mThe kernel failed to start due to the missing module 'pygments.formatters.terminal256'. Consider installing this module.\n", |
| 38 | + "\u001b[1;31mClick <a href='https://aka.ms/kernelFailuresMissingModule'>here</a> for more info." |
| 39 | + ] |
| 40 | + } |
| 41 | + ], |
28 | 42 | "source": [ |
29 | 43 | "import dotenv\n", |
30 | 44 | "import logging\n", |
|
36 | 50 | "cell_type": "code", |
37 | 51 | "execution_count": null, |
38 | 52 | "metadata": {}, |
39 | | - "outputs": [], |
| 53 | + "outputs": [ |
| 54 | + { |
| 55 | + "ename": "", |
| 56 | + "evalue": "", |
| 57 | + "output_type": "error", |
| 58 | + "traceback": [ |
| 59 | + "\u001b[1;31mThe kernel failed to start due to the missing module 'pygments.formatters.terminal256'. Consider installing this module.\n", |
| 60 | + "\u001b[1;31mClick <a href='https://aka.ms/kernelFailuresMissingModule'>here</a> for more info." |
| 61 | + ] |
| 62 | + } |
| 63 | + ], |
40 | 64 | "source": [ |
41 | 65 | "logging.basicConfig(level=logging.INFO)" |
42 | 66 | ] |
|
45 | 69 | "cell_type": "code", |
46 | 70 | "execution_count": null, |
47 | 71 | "metadata": {}, |
48 | | - "outputs": [], |
| 72 | + "outputs": [ |
| 73 | + { |
| 74 | + "ename": "", |
| 75 | + "evalue": "", |
| 76 | + "output_type": "error", |
| 77 | + "traceback": [ |
| 78 | + "\u001b[1;31mThe kernel failed to start due to the missing module 'pygments.formatters.terminal256'. Consider installing this module.\n", |
| 79 | + "\u001b[1;31mClick <a href='https://aka.ms/kernelFailuresMissingModule'>here</a> for more info." |
| 80 | + ] |
| 81 | + } |
| 82 | + ], |
49 | 83 | "source": [ |
50 | 84 | "dotenv.load_dotenv()" |
51 | 85 | ] |
|
61 | 95 | "cell_type": "code", |
62 | 96 | "execution_count": null, |
63 | 97 | "metadata": {}, |
64 | | - "outputs": [], |
| 98 | + "outputs": [ |
| 99 | + { |
| 100 | + "ename": "", |
| 101 | + "evalue": "", |
| 102 | + "output_type": "error", |
| 103 | + "traceback": [ |
| 104 | + "\u001b[1;31mThe kernel failed to start due to the missing module 'pygments.formatters.terminal256'. Consider installing this module.\n", |
| 105 | + "\u001b[1;31mClick <a href='https://aka.ms/kernelFailuresMissingModule'>here</a> for more info." |
| 106 | + ] |
| 107 | + } |
| 108 | + ], |
65 | 109 | "source": [ |
66 | 110 | "agentic_text_2_sql = AutoGenText2Sql(target_engine=\"TSQL\", engine_specific_rules=\"Use TOP X to limit the number of rows returned instead of LIMIT X. NEVER USE LIMIT X as it produces a syntax error.\").agentic_flow" |
67 | 111 | ] |
|
70 | 114 | "cell_type": "code", |
71 | 115 | "execution_count": null, |
72 | 116 | "metadata": {}, |
73 | | - "outputs": [], |
| 117 | + "outputs": [ |
| 118 | + { |
| 119 | + "ename": "", |
| 120 | + "evalue": "", |
| 121 | + "output_type": "error", |
| 122 | + "traceback": [ |
| 123 | + "\u001b[1;31mThe kernel failed to start due to the missing module 'pygments.formatters.terminal256'. Consider installing this module.\n", |
| 124 | + "\u001b[1;31mClick <a href='https://aka.ms/kernelFailuresMissingModule'>here</a> for more info." |
| 125 | + ] |
| 126 | + } |
| 127 | + ], |
74 | 128 | "source": [ |
75 | 129 | "result = agentic_text_2_sql.run_stream(task=\"What are the total number of sales within 2008?\")" |
76 | 130 | ] |
|
79 | 133 | "cell_type": "code", |
80 | 134 | "execution_count": null, |
81 | 135 | "metadata": {}, |
82 | | - "outputs": [], |
| 136 | + "outputs": [ |
| 137 | + { |
| 138 | + "ename": "", |
| 139 | + "evalue": "", |
| 140 | + "output_type": "error", |
| 141 | + "traceback": [ |
| 142 | + "\u001b[1;31mThe kernel failed to start due to the missing module 'pygments.formatters.terminal256'. Consider installing this module.\n", |
| 143 | + "\u001b[1;31mClick <a href='https://aka.ms/kernelFailuresMissingModule'>here</a> for more info." |
| 144 | + ] |
| 145 | + } |
| 146 | + ], |
83 | 147 | "source": [ |
84 | 148 | "await Console(result)" |
85 | 149 | ] |
|
88 | 152 | "cell_type": "code", |
89 | 153 | "execution_count": null, |
90 | 154 | "metadata": {}, |
91 | | - "outputs": [], |
| 155 | + "outputs": [ |
| 156 | + { |
| 157 | + "ename": "", |
| 158 | + "evalue": "", |
| 159 | + "output_type": "error", |
| 160 | + "traceback": [ |
| 161 | + "\u001b[1;31mThe kernel failed to start due to the missing module 'pygments.formatters.terminal256'. Consider installing this module.\n", |
| 162 | + "\u001b[1;31mClick <a href='https://aka.ms/kernelFailuresMissingModule'>here</a> for more info." |
| 163 | + ] |
| 164 | + } |
| 165 | + ], |
92 | 166 | "source": [] |
93 | 167 | } |
94 | 168 | ], |
|
0 commit comments