Skip to content

Commit 3fb007e

Browse files
authored
[Conversational Snippet] add missing semicolons (#1032)
[Conversational Snippet] add missing semicolons
1 parent f193bc6 commit 3fb007e

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

packages/tasks/src/snippets/js.spec.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ describe("inference API snippets", () => {
1212
};
1313
const snippet = getJsInferenceSnippet(model, "api_token") as InferenceSnippet[];
1414

15-
expect(snippet[0].content).toEqual(`import { HfInference } from "@huggingface/inference"
15+
expect(snippet[0].content).toEqual(`import { HfInference } from "@huggingface/inference";
1616
17-
const client = new HfInference("api_token")
17+
const client = new HfInference("api_token");
1818
1919
let out = "";
2020
@@ -47,9 +47,9 @@ for await (const chunk of stream) {
4747
};
4848
const snippet = getJsInferenceSnippet(model, "api_token", { streaming: false }) as InferenceSnippet[];
4949

50-
expect(snippet[0].content).toEqual(`import { HfInference } from "@huggingface/inference"
50+
expect(snippet[0].content).toEqual(`import { HfInference } from "@huggingface/inference";
5151
52-
const client = new HfInference("api_token")
52+
const client = new HfInference("api_token");
5353
5454
const chatCompletion = await client.chatCompletion({
5555
model: "meta-llama/Llama-3.1-8B-Instruct",
@@ -74,9 +74,9 @@ console.log(chatCompletion.choices[0].message);`);
7474
};
7575
const snippet = getJsInferenceSnippet(model, "api_token") as InferenceSnippet[];
7676

77-
expect(snippet[0].content).toEqual(`import { HfInference } from "@huggingface/inference"
77+
expect(snippet[0].content).toEqual(`import { HfInference } from "@huggingface/inference";
7878
79-
const client = new HfInference("api_token")
79+
const client = new HfInference("api_token");
8080
8181
let out = "";
8282
@@ -120,9 +120,9 @@ for await (const chunk of stream) {
120120
};
121121
const snippet = getJsInferenceSnippet(model, "api_token") as InferenceSnippet[];
122122

123-
expect(snippet[0].content).toEqual(`import { HfInference } from "@huggingface/inference"
123+
expect(snippet[0].content).toEqual(`import { HfInference } from "@huggingface/inference";
124124
125-
const client = new HfInference("api_token")
125+
const client = new HfInference("api_token");
126126
127127
let out = "";
128128

packages/tasks/src/snippets/js.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ export const snippetTextGeneration = (
5858
return [
5959
{
6060
client: "huggingface.js",
61-
content: `import { HfInference } from "@huggingface/inference"
61+
content: `import { HfInference } from "@huggingface/inference";
6262
63-
const client = new HfInference("${accessToken || `{API_TOKEN}`}")
63+
const client = new HfInference("${accessToken || `{API_TOKEN}`}");
6464
6565
let out = "";
6666
@@ -80,12 +80,12 @@ for await (const chunk of stream) {
8080
},
8181
{
8282
client: "openai",
83-
content: `import { OpenAI } from "openai"
83+
content: `import { OpenAI } from "openai";
8484
8585
const client = new OpenAI({
8686
baseURL: "https://api-inference.huggingface.co/v1/",
8787
apiKey: "${accessToken || `{API_TOKEN}`}"
88-
})
88+
});
8989
9090
let out = "";
9191
@@ -109,9 +109,9 @@ for await (const chunk of stream) {
109109
return [
110110
{
111111
client: "huggingface.js",
112-
content: `import { HfInference } from "@huggingface/inference"
112+
content: `import { HfInference } from "@huggingface/inference";
113113
114-
const client = new HfInference("${accessToken || `{API_TOKEN}`}")
114+
const client = new HfInference("${accessToken || `{API_TOKEN}`}");
115115
116116
const chatCompletion = await client.chatCompletion({
117117
model: "${model.id}",
@@ -123,12 +123,12 @@ console.log(chatCompletion.choices[0].message);`,
123123
},
124124
{
125125
client: "openai",
126-
content: `import { OpenAI } from "openai"
126+
content: `import { OpenAI } from "openai";
127127
128128
const client = new OpenAI({
129129
baseURL: "https://api-inference.huggingface.co/v1/",
130130
apiKey: "${accessToken || `{API_TOKEN}`}"
131-
})
131+
});
132132
133133
const chatCompletion = await client.chat.completions.create({
134134
model: "${model.id}",

0 commit comments

Comments
 (0)