From 33dbb3f0f21299520437d7f1eebc2e5517af6889 Mon Sep 17 00:00:00 2001 From: wkellmann Date: Thu, 11 Jul 2024 17:22:39 +0200 Subject: [PATCH] changing the default proxy_url (ps_api_base) --- examples/openai_sdk_openai.ipynb | 135 +++++++++++++++++++++++-------- 1 file changed, 102 insertions(+), 33 deletions(-) diff --git a/examples/openai_sdk_openai.ipynb b/examples/openai_sdk_openai.ipynb index 2c0241d7..5aa8fd61 100644 --- a/examples/openai_sdk_openai.ipynb +++ b/examples/openai_sdk_openai.ipynb @@ -70,7 +70,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 2, "metadata": { "ExecuteTime": { "end_time": "2024-07-01T11:18:23.512730Z", @@ -158,7 +158,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 3, "metadata": { "ExecuteTime": { "end_time": "2024-07-01T11:18:25.543634Z", @@ -274,7 +274,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 4, "metadata": { "ExecuteTime": { "end_time": "2024-07-01T11:18:28.982007Z", @@ -311,11 +311,50 @@ { "data": { "text/html": [ - "
finite\n",
+       "
 code\n",
+       "
\n" + ], + "text/plain": [ + " code\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
's\n",
+       "
\n" + ], + "text/plain": [ + "'s\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
 dance\n",
+       "
\n" + ], + "text/plain": [ + " dance\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
,\n",
        "
\n" ], "text/plain": [ - "finite\n" + ",\n" ] }, "metadata": {}, @@ -324,11 +363,11 @@ { "data": { "text/html": [ - "
 loop\n",
+       "
 returns\n",
        "
\n" ], "text/plain": [ - " loop\n" + " returns\n" ] }, "metadata": {}, @@ -352,11 +391,24 @@ { "data": { "text/html": [ - "
Function\n",
+       "
A\n",
        "
\n" ], "text/plain": [ - "Function\n" + "A\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
 function\n",
+       "
\n" + ], + "text/plain": [ + " function\n" ] }, "metadata": {}, @@ -391,11 +443,11 @@ { "data": { "text/html": [ - "
 again\n",
+       "
,\n",
        "
\n" ], "text/plain": [ - " again\n" + ",\n" ] }, "metadata": {}, @@ -404,12 +456,12 @@ { "data": { "text/html": [ - "
,\n",
+       "
 \n",
        "\n",
        "
\n" ], "text/plain": [ - ",\n", + " \n", "\n" ] }, @@ -419,11 +471,11 @@ { "data": { "text/html": [ - "
Rec\n",
+       "
Echo\n",
        "
\n" ], "text/plain": [ - "Rec\n" + "Echo\n" ] }, "metadata": {}, @@ -432,11 +484,11 @@ { "data": { "text/html": [ - "
ursion\n",
+       "
es\n",
        "
\n" ], "text/plain": [ - "ursion\n" + "es\n" ] }, "metadata": {}, @@ -445,11 +497,11 @@ { "data": { "text/html": [ - "
 blooms\n",
+       "
 in\n",
        "
\n" ], "text/plain": [ - " blooms\n" + " in\n" ] }, "metadata": {}, @@ -458,11 +510,24 @@ { "data": { "text/html": [ - "
 bright\n",
+       "
 the\n",
        "
\n" ], "text/plain": [ - " bright\n" + " the\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
 void\n",
+       "
\n" + ], + "text/plain": [ + " void\n" ] }, "metadata": {}, @@ -539,7 +604,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 7, "metadata": { "ExecuteTime": { "end_time": "2024-07-01T11:23:47.598219Z", @@ -550,19 +615,23 @@ { "data": { "text/html": [ - "
The distance between Earth and Mars varies depending on their positions in their respective orbits around the Sun. \n",
-       "On average, the distance between Earth and Mars is about 225 million kilometers (140 million miles). However, \n",
-       "because both planets have elliptical orbits, this distance can range from about 54.6 million kilometers (33.9 \n",
-       "million miles) at their closest approach (opposition) to about 401 million kilometers (249 million miles) at their \n",
-       "farthest distance (conjunction).\n",
+       "
The distance between Earth and Mars varies depending on their positions in their respective orbits around the Sun, \n",
+       "as both planets have elliptical orbits. On average, the distance between Earth and Mars is about 225 million \n",
+       "kilometers (140 million miles).\n",
+       "\n",
+       "However, the minimum distance between Earth and Mars (opposition) can be as close as about 54.6 million kilometers \n",
+       "(33.9 million miles), while the maximum distance (conjunction) can be as far as about 401 million kilometers (249 \n",
+       "million miles).\n",
        "
\n" ], "text/plain": [ - "The distance between Earth and Mars varies depending on their positions in their respective orbits around the Sun. \n", - "On average, the distance between Earth and Mars is about \u001b[1;36m225\u001b[0m million kilometers \u001b[1m(\u001b[0m\u001b[1;36m140\u001b[0m million miles\u001b[1m)\u001b[0m. However, \n", - "because both planets have elliptical orbits, this distance can range from about \u001b[1;36m54.6\u001b[0m million kilometers \u001b[1m(\u001b[0m\u001b[1;36m33.9\u001b[0m \n", - "million miles\u001b[1m)\u001b[0m at their closest approach \u001b[1m(\u001b[0mopposition\u001b[1m)\u001b[0m to about \u001b[1;36m401\u001b[0m million kilometers \u001b[1m(\u001b[0m\u001b[1;36m249\u001b[0m million miles\u001b[1m)\u001b[0m at their \n", - "farthest distance \u001b[1m(\u001b[0mconjunction\u001b[1m)\u001b[0m.\n" + "The distance between Earth and Mars varies depending on their positions in their respective orbits around the Sun, \n", + "as both planets have elliptical orbits. On average, the distance between Earth and Mars is about \u001b[1;36m225\u001b[0m million \n", + "kilometers \u001b[1m(\u001b[0m\u001b[1;36m140\u001b[0m million miles\u001b[1m)\u001b[0m.\n", + "\n", + "However, the minimum distance between Earth and Mars \u001b[1m(\u001b[0mopposition\u001b[1m)\u001b[0m can be as close as about \u001b[1;36m54.6\u001b[0m million kilometers \n", + "\u001b[1m(\u001b[0m\u001b[1;36m33.9\u001b[0m million miles\u001b[1m)\u001b[0m, while the maximum distance \u001b[1m(\u001b[0mconjunction\u001b[1m)\u001b[0m can be as far as about \u001b[1;36m401\u001b[0m million kilometers \u001b[1m(\u001b[0m\u001b[1;36m249\u001b[0m \n", + "million miles\u001b[1m)\u001b[0m.\n" ] }, "metadata": {}, @@ -570,7 +639,7 @@ } ], "source": [ - "ps_api_base = \"https://try-promptsail.azurewebsites.net/api/models-playground/openai\"\n", + "ps_api_base = \"http://localhost:8000/models-playground/openai/\"\n", "\n", "# adress with tags \n", "#ps_api_base = \"http://localhost:8000/models-playground/openai/?tags=examples,openai_sdk,chat,user_ks&target_path=\"\n",