|
55 | 55 | "metadata": {}, |
56 | 56 | "outputs": [], |
57 | 57 | "source": [ |
58 | | - "!python -m pip install semantic-kernel==0.4.3.dev0" |
| 58 | + "!python -m pip install semantic-kernel==0.4.4.dev0" |
59 | 59 | ] |
60 | 60 | }, |
61 | 61 | { |
|
66 | 66 | "outputs": [], |
67 | 67 | "source": [ |
68 | 68 | "import semantic_kernel as sk\n", |
69 | | - "from semantic_kernel.connectors.ai.open_ai import AzureTextCompletion, OpenAITextCompletion\n", |
| 69 | + "from semantic_kernel.connectors.ai.open_ai import (\n", |
| 70 | + " AzureTextCompletion,\n", |
| 71 | + " OpenAITextCompletion,\n", |
| 72 | + ")\n", |
70 | 73 | "\n", |
71 | 74 | "kernel = sk.Kernel()\n", |
72 | 75 | "\n", |
|
75 | 78 | "# Configure AI service used by the kernel\n", |
76 | 79 | "if useAzureOpenAI:\n", |
77 | 80 | " deployment, api_key, endpoint = sk.azure_openai_settings_from_dot_env()\n", |
78 | | - " azure_text_service = AzureTextCompletion(deployment_name=\"text\", endpoint=endpoint, api_key=api_key) # set the deployment name to the value of your text model\n", |
| 81 | + " azure_text_service = AzureTextCompletion(\n", |
| 82 | + " deployment_name=\"text\", endpoint=endpoint, api_key=api_key\n", |
| 83 | + " ) # set the deployment name to the value of your text model\n", |
79 | 84 | " kernel.add_text_completion_service(\"dv\", azure_text_service)\n", |
80 | 85 | "else:\n", |
81 | 86 | " api_key, org_id = sk.openai_settings_from_dot_env()\n", |
|
196 | 201 | "outputs": [], |
197 | 202 | "source": [ |
198 | 203 | "import semantic_kernel as sk\n", |
199 | | - "from semantic_kernel.connectors.ai.open_ai import AzureChatCompletion, OpenAIChatCompletion\n", |
| 204 | + "from semantic_kernel.connectors.ai.open_ai import (\n", |
| 205 | + " AzureChatCompletion,\n", |
| 206 | + " OpenAIChatCompletion,\n", |
| 207 | + ")\n", |
200 | 208 | "\n", |
201 | 209 | "kernel = sk.Kernel()\n", |
202 | 210 | "\n", |
|
205 | 213 | "# Configure AI service used by the kernel\n", |
206 | 214 | "if useAzureOpenAI:\n", |
207 | 215 | " deployment, api_key, endpoint = sk.azure_openai_settings_from_dot_env()\n", |
208 | | - " azure_chat_service = AzureChatCompletion(deployment_name=\"turbo\", endpoint=endpoint, api_key=api_key) # set the deployment name to the value of your chat model\n", |
| 216 | + " azure_chat_service = AzureChatCompletion(\n", |
| 217 | + " deployment_name=\"turbo\", endpoint=endpoint, api_key=api_key\n", |
| 218 | + " ) # set the deployment name to the value of your chat model\n", |
209 | 219 | " kernel.add_chat_service(\"chat_completion\", azure_chat_service)\n", |
210 | 220 | "else:\n", |
211 | 221 | " api_key, org_id = sk.openai_settings_from_dot_env()\n", |
|
241 | 251 | "\n", |
242 | 252 | "summary = tldr_function(text)\n", |
243 | 253 | "\n", |
244 | | - "print(f\"Output: {summary}\") # Output: Robots must not harm humans." |
| 254 | + "print(f\"Output: {summary}\") # Output: Robots must not harm humans." |
245 | 255 | ] |
246 | 256 | } |
247 | 257 | ], |
|
0 commit comments