You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To use the Python client, see `huggingface_hub`'s [package reference](https://huggingface.co/docs/huggingface_hub/package_reference/inference_client#huggingface_hub.InferenceClient.chat_completion).
@@ -160,9 +161,9 @@ for await (const chunk of stream) {
160
161
console.log(newContent);
161
162
}
162
163
}
163
-
</huggingface_hub>
164
164
165
-
<openai>
165
+
# With openai client
166
+
166
167
import { OpenAI } from"openai"
167
168
168
169
constclient=newOpenAI({
@@ -191,7 +192,6 @@ for await (const chunk of stream) {
191
192
console.log(newContent);
192
193
}
193
194
}
194
-
</openai>
195
195
```
196
196
197
197
To use the JavaScript client, see `huggingface.js`'s [package reference](https://huggingface.co/docs/huggingface.js/inference/classes/HfInference#chatcompletion).
To use the Python client, see `huggingface_hub`'s [package reference](https://huggingface.co/docs/huggingface_hub/package_reference/inference_client#huggingface_hub.InferenceClient.chat_completion).
@@ -351,9 +352,9 @@ for await (const chunk of stream) {
351
352
console.log(newContent);
352
353
}
353
354
}
354
-
</huggingface_hub>
355
355
356
-
<openai>
356
+
# With openai client
357
+
357
358
import { OpenAI } from"openai"
358
359
359
360
constclient=newOpenAI({
@@ -393,7 +394,6 @@ for await (const chunk of stream) {
393
394
console.log(newContent);
394
395
}
395
396
}
396
-
</openai>
397
397
```
398
398
399
399
To use the JavaScript client, see `huggingface.js`'s [package reference](https://huggingface.co/docs/huggingface.js/inference/classes/HfInference#chatcompletion).
To use the Python client, see `huggingface_hub`'s [package reference](https://huggingface.co/docs/huggingface_hub/package_reference/inference_client#huggingface_hub.InferenceClient.image_text-to-text).
0 commit comments