|
59 | 59 | "import os\n",
|
60 | 60 | "import sys\n",
|
61 | 61 | "import semantic_kernel as sk\n",
|
62 |
| - "from semantic_kernel.connectors.ai.open_ai import AzureTextCompletion, OpenAITextCompletion\n", |
| 62 | + "from semantic_kernel.connectors.ai.open_ai import AzureChatCompletion, OpenAIChatCompletion\n", |
63 | 63 | "\n",
|
64 | 64 | "kernel = sk.Kernel()\n",
|
65 | 65 | "\n",
|
|
69 | 69 | "# Configure AI service used by the kernel\n",
|
70 | 70 | "if useAzureOpenAI:\n",
|
71 | 71 | " deployment, api_key, endpoint = sk.azure_openai_settings_from_dot_env()\n",
|
72 |
| - " kernel.add_text_completion_service(\"dv\", AzureTextCompletion(deployment, endpoint, api_key))\n", |
| 72 | + " kernel.add_chat_service(\"chat_completion\", AzureChatCompletion(\"gpt-35-turbo\", endpoint, api_key))\n", |
73 | 73 | "else:\n",
|
74 | 74 | " api_key, org_id = sk.openai_settings_from_dot_env()\n",
|
75 |
| - " kernel.add_text_completion_service(\"dv\", OpenAITextCompletion(\"text-davinci-003\", api_key, org_id))" |
| 75 | + " kernel.add_chat_service(\"chat-gpt\", OpenAIChatCompletion(\"gpt-3.5-turbo\", api_key, org_id))" |
76 | 76 | ]
|
77 | 77 | },
|
78 | 78 | {
|
|
225 | 225 | "import os\n",
|
226 | 226 | "import sys\n",
|
227 | 227 | "import semantic_kernel as sk\n",
|
228 |
| - "from semantic_kernel.connectors.ai.open_ai import AzureTextCompletion, OpenAITextCompletion\n", |
| 228 | + "from semantic_kernel.connectors.ai.open_ai import AzureChatCompletion, OpenAIChatCompletion\n", |
229 | 229 | "\n",
|
230 | 230 | "kernel = sk.Kernel()\n",
|
231 | 231 | "\n",
|
|
235 | 235 | "# Configure AI service used by the kernel\n",
|
236 | 236 | "if useAzureOpenAI:\n",
|
237 | 237 | " deployment, api_key, endpoint = sk.azure_openai_settings_from_dot_env()\n",
|
238 |
| - " kernel.add_text_completion_service(\"dv\", AzureTextCompletion(deployment, endpoint, api_key))\n", |
| 238 | + " kernel.add_chat_service(\"chat_completion\", AzureChatCompletion(\"gpt-35-turbo\", endpoint, api_key))\n", |
239 | 239 | "else:\n",
|
240 | 240 | " api_key, org_id = sk.openai_settings_from_dot_env()\n",
|
241 |
| - " kernel.add_text_completion_service(\"dv\", OpenAITextCompletion(\"text-davinci-003\", api_key, org_id))" |
| 241 | + " kernel.add_chat_service(\"chat-gpt\", OpenAIChatCompletion(\"gpt-3.5-turbo\", api_key, org_id))\n" |
242 | 242 | ]
|
243 | 243 | },
|
244 | 244 | {
|
|
0 commit comments