|
|
|
@ -63,7 +63,21 @@
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "code",
|
|
|
|
|
"execution_count": 1,
|
|
|
|
|
"execution_count": 3,
|
|
|
|
|
"id": "faacfa54",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"outputs": [],
|
|
|
|
|
"source": [
|
|
|
|
|
"import os\n",
|
|
|
|
|
"os.environ[\"OPENAI_API_TYPE\"] = \"azure\"\n",
|
|
|
|
|
"os.environ[\"OPENAI_API_VERSION\"] = \"2022-12-01\"\n",
|
|
|
|
|
"os.environ[\"OPENAI_API_BASE\"] = \"...\"\n",
|
|
|
|
|
"os.environ[\"OPENAI_API_KEY\"] = \"...\""
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "code",
|
|
|
|
|
"execution_count": 4,
|
|
|
|
|
"id": "8fad2a6e",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"outputs": [],
|
|
|
|
@ -74,29 +88,32 @@
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "code",
|
|
|
|
|
"execution_count": 2,
|
|
|
|
|
"execution_count": 5,
|
|
|
|
|
"id": "8c80213a",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"outputs": [],
|
|
|
|
|
"source": [
|
|
|
|
|
"# Create an instance of Azure OpenAI\n",
|
|
|
|
|
"# Replace the deployment name with your own\n",
|
|
|
|
|
"llm = AzureOpenAI(deployment_name=\"text-davinci-002-prod\", model_name=\"text-davinci-002\")"
|
|
|
|
|
"llm = AzureOpenAI(\n",
|
|
|
|
|
" deployment_name=\"td2\",\n",
|
|
|
|
|
" model_name=\"text-davinci-002\", \n",
|
|
|
|
|
")"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "code",
|
|
|
|
|
"execution_count": 3,
|
|
|
|
|
"execution_count": 6,
|
|
|
|
|
"id": "592dc404",
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"outputs": [
|
|
|
|
|
{
|
|
|
|
|
"data": {
|
|
|
|
|
"text/plain": [
|
|
|
|
|
"'\\n\\nWhy did the chicken cross the road?\\n\\nTo get to the other side.'"
|
|
|
|
|
"\"\\n\\nWhy couldn't the bicycle stand up by itself? Because it was...two tired!\""
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
"execution_count": 3,
|
|
|
|
|
"execution_count": 6,
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"output_type": "execute_result"
|
|
|
|
|
}
|
|
|
|
@ -158,7 +175,7 @@
|
|
|
|
|
"name": "python",
|
|
|
|
|
"nbconvert_exporter": "python",
|
|
|
|
|
"pygments_lexer": "ipython3",
|
|
|
|
|
"version": "3.10.6"
|
|
|
|
|
"version": "3.9.1"
|
|
|
|
|
},
|
|
|
|
|
"vscode": {
|
|
|
|
|
"interpreter": {
|
|
|
|
|