Skip to content

Commit

Permalink
changing the default proxy_url (ps_api_base)
Browse files Browse the repository at this point in the history
  • Loading branch information
WiolaGreen committed Jul 11, 2024
1 parent aa5b73a commit 33dbb3f
Showing 1 changed file with 102 additions and 33 deletions.
135 changes: 102 additions & 33 deletions examples/openai_sdk_openai.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 2,
"metadata": {
"ExecuteTime": {
"end_time": "2024-07-01T11:18:23.512730Z",
Expand Down Expand Up @@ -158,7 +158,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 3,
"metadata": {
"ExecuteTime": {
"end_time": "2024-07-01T11:18:25.543634Z",
Expand Down Expand Up @@ -274,7 +274,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 4,
"metadata": {
"ExecuteTime": {
"end_time": "2024-07-01T11:18:28.982007Z",
Expand Down Expand Up @@ -311,11 +311,50 @@
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">finite\n",
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"> code\n",
"</pre>\n"
],
"text/plain": [
" code\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">'s\n",
"</pre>\n"
],
"text/plain": [
"'s\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"> dance\n",
"</pre>\n"
],
"text/plain": [
" dance\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">,\n",
"</pre>\n"
],
"text/plain": [
"finite\n"
",\n"
]
},
"metadata": {},
Expand All @@ -324,11 +363,11 @@
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"> loop\n",
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"> returns\n",
"</pre>\n"
],
"text/plain": [
" loop\n"
" returns\n"
]
},
"metadata": {},
Expand All @@ -352,11 +391,24 @@
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">Function\n",
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">A\n",
"</pre>\n"
],
"text/plain": [
"Function\n"
"A\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"> function\n",
"</pre>\n"
],
"text/plain": [
" function\n"
]
},
"metadata": {},
Expand Down Expand Up @@ -391,11 +443,11 @@
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"> again\n",
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">,\n",
"</pre>\n"
],
"text/plain": [
" again\n"
",\n"
]
},
"metadata": {},
Expand All @@ -404,12 +456,12 @@
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">,\n",
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"> \n",
"\n",
"</pre>\n"
],
"text/plain": [
",\n",
" \n",
"\n"
]
},
Expand All @@ -419,11 +471,11 @@
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">Rec\n",
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">Echo\n",
"</pre>\n"
],
"text/plain": [
"Rec\n"
"Echo\n"
]
},
"metadata": {},
Expand All @@ -432,11 +484,11 @@
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">ursion\n",
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">es\n",
"</pre>\n"
],
"text/plain": [
"ursion\n"
"es\n"
]
},
"metadata": {},
Expand All @@ -445,11 +497,11 @@
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"> blooms\n",
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"> in\n",
"</pre>\n"
],
"text/plain": [
" blooms\n"
" in\n"
]
},
"metadata": {},
Expand All @@ -458,11 +510,24 @@
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"> bright\n",
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"> the\n",
"</pre>\n"
],
"text/plain": [
" bright\n"
" the\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"> void\n",
"</pre>\n"
],
"text/plain": [
" void\n"
]
},
"metadata": {},
Expand Down Expand Up @@ -539,7 +604,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 7,
"metadata": {
"ExecuteTime": {
"end_time": "2024-07-01T11:23:47.598219Z",
Expand All @@ -550,27 +615,31 @@
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">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 <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">225</span> million kilometers <span style=\"font-weight: bold\">(</span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">140</span> million miles<span style=\"font-weight: bold\">)</span>. However, \n",
"because both planets have elliptical orbits, this distance can range from about <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">54.6</span> million kilometers <span style=\"font-weight: bold\">(</span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">33.9</span> \n",
"million miles<span style=\"font-weight: bold\">)</span> at their closest approach <span style=\"font-weight: bold\">(</span>opposition<span style=\"font-weight: bold\">)</span> to about <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">401</span> million kilometers <span style=\"font-weight: bold\">(</span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">249</span> million miles<span style=\"font-weight: bold\">)</span> at their \n",
"farthest distance <span style=\"font-weight: bold\">(</span>conjunction<span style=\"font-weight: bold\">)</span>.\n",
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">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 <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">225</span> million \n",
"kilometers <span style=\"font-weight: bold\">(</span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">140</span> million miles<span style=\"font-weight: bold\">)</span>.\n",
"\n",
"However, the minimum distance between Earth and Mars <span style=\"font-weight: bold\">(</span>opposition<span style=\"font-weight: bold\">)</span> can be as close as about <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">54.6</span> million kilometers \n",
"<span style=\"font-weight: bold\">(</span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">33.9</span> million miles<span style=\"font-weight: bold\">)</span>, while the maximum distance <span style=\"font-weight: bold\">(</span>conjunction<span style=\"font-weight: bold\">)</span> can be as far as about <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">401</span> million kilometers <span style=\"font-weight: bold\">(</span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">249</span> \n",
"million miles<span style=\"font-weight: bold\">)</span>.\n",
"</pre>\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": {},
"output_type": "display_data"
}
],
"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",
Expand Down

0 comments on commit 33dbb3f

Please sign in to comment.