Skip to content

Commit 44a7074

Browse files
WuhanMonkeysubramen
authored andcommitted
Update the streaming API from str to bool based on API backend update
1 parent fa02ded commit 44a7074

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

recipes/llama_api_providers/Azure_API_example/azure_api_example.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
"Streaming allows the generated tokens to be sent as data-only server-sent events whenever they become available. \n",
9797
"This is extremely important for interactive applications such as chatbots, so the user is always engaged. \n",
9898
"\n",
99-
"To use streaming, simply set `\"stream\":\"True\"` as part of the request payload. \n",
99+
"To use streaming, simply set `\"stream\":True` as part of the request payload. \n",
100100
"In the streaming mode, the REST API response will be different from non-streaming mode.\n",
101101
"\n",
102102
"Here is an example: "
@@ -108,7 +108,7 @@
108108
"metadata": {},
109109
"outputs": [],
110110
"source": [
111-
"!curl -X POST -L https://your-endpoint.inference.ai.azure.com/v1/chat/completions -H 'Content-Type: application/json' -H 'Authorization: your-auth-key' -d '{\"messages\":[{\"content\":\"You are a helpful assistant.\",\"role\":\"system\"},{\"content\":\"Who wrote the book Innovators dilemma?\",\"role\":\"user\"}], \"max_tokens\": 500, \"stream\": \"True\"}'"
111+
"!curl -X POST -L https://your-endpoint.inference.ai.azure.com/v1/chat/completions -H 'Content-Type: application/json' -H 'Authorization: your-auth-key' -d '{\"messages\":[{\"content\":\"You are a helpful assistant.\",\"role\":\"system\"},{\"content\":\"Who wrote the book Innovators dilemma?\",\"role\":\"user\"}], \"max_tokens\": 500, \"stream\": True}'"
112112
]
113113
},
114114
{
@@ -170,7 +170,7 @@
170170
" {\"role\":\"user\", \"content\":\"Who wrote the book Innovators dilemma?\"}], \n",
171171
" \"max_tokens\": 500,\n",
172172
" \"temperature\": 0.9,\n",
173-
" \"stream\": \"True\",\n",
173+
" \"stream\": True,\n",
174174
"}\n",
175175
"\n",
176176
"body = str.encode(json.dumps(data))\n",
@@ -230,7 +230,7 @@
230230
" {\"role\":\"user\", \"content\":\"Who wrote the book Innovators dilemma?\"}],\n",
231231
" \"max_tokens\": 500,\n",
232232
" \"temperature\": 0.9,\n",
233-
" \"stream\": \"True\"\n",
233+
" \"stream\": True\n",
234234
"}\n",
235235
"\n",
236236
"\n",

0 commit comments

Comments
 (0)