Skip to content

Commit 0b35b19

Browse files
authored
chore: ran the deno fmt command with default conf (#37)
1 parent 9bb0b83 commit 0b35b19

5 files changed

Lines changed: 21 additions & 21 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ const openAI = new OpenAI(Deno.env.get("YOUR_API_KEY")!);
128128

129129
const transcription = await openAI.createTranscription({
130130
model: "whisper-1",
131-
file: '/path/to/your/audio/file.mp3',
131+
file: "/path/to/your/audio/file.mp3",
132132
});
133133

134134
console.log(transcription);

examples/chatCompletionFunction.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const openAI = new OpenAI(Deno.env.get("YOUR_API_KEY")!);
55
const chatCompletion = await openAI.createChatCompletion({
66
model: "gpt-3.5-turbo",
77
messages: [
8-
{"role": "user", "content": "What is the weather like in Boston?"}
8+
{ "role": "user", "content": "What is the weather like in Boston?" },
99
],
1010
function_call: { name: "get_current_weather" },
1111
functions: [
@@ -17,17 +17,17 @@ const chatCompletion = await openAI.createChatCompletion({
1717
"properties": {
1818
"location": {
1919
"type": "string",
20-
"description": "The city and state, e.g. San Francisco, CA"
20+
"description": "The city and state, e.g. San Francisco, CA",
2121
},
2222
"unit": {
2323
"type": "string",
24-
"enum": ["celsius", "fahrenheit"]
25-
}
24+
"enum": ["celsius", "fahrenheit"],
25+
},
2626
},
27-
"required": ["location"]
28-
}
29-
}
30-
]
27+
"required": ["location"],
28+
},
29+
},
30+
],
3131
});
3232

3333
console.log(chatCompletion);

src/deps.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
export { TextDelimiterStream } from "https://deno.land/std@0.204.0/streams/mod.ts";
2-
export { basename } from "https://deno.land/std@0.204.0/path/mod.ts";
2+
export { basename } from "https://deno.land/std@0.204.0/path/mod.ts";

src/openai.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ export class OpenAI {
186186

187187
// null coalesce content to empty string as discussed in PR #17
188188
resp?.choices?.forEach(
189-
(choice) => (choice.message.content = choice.message.content ?? "")
189+
(choice) => (choice.message.content = choice.message.content ?? ""),
190190
);
191191
return resp;
192192
}
@@ -222,7 +222,7 @@ export class OpenAI {
222222
logit_bias: options.logitBias,
223223
user: options.user,
224224
functions: options.functions,
225-
function_call: options.function_call
225+
function_call: options.function_call,
226226
}),
227227
},
228228
);
@@ -285,11 +285,11 @@ export class OpenAI {
285285
formData.append("image", options.image as unknown as Blob);
286286
}
287287

288-
if (options.n) { formData.append("n", options.n); }
289-
if (options.mask) { formData.append("mask", options.mask); }
290-
if (options.prompt) { formData.append("prompt", options.prompt); }
291-
if (options.size) { formData.append("size", options.size); }
292-
if (options.user) { formData.append("user", options.user); }
288+
if (options.n) formData.append("n", options.n);
289+
if (options.mask) formData.append("mask", options.mask);
290+
if (options.prompt) formData.append("prompt", options.prompt);
291+
if (options.size) formData.append("size", options.size);
292+
if (options.user) formData.append("user", options.user);
293293
if (options.responseFormat) {
294294
formData.append("response_format", options.responseFormat);
295295
}
@@ -324,9 +324,9 @@ export class OpenAI {
324324
formData.append("image", options.image as unknown as Blob);
325325
}
326326

327-
if (options.n) { formData.append("n", options.n); }
328-
if (options.size) { formData.append("size", options.size); }
329-
if (options.user) { formData.append("user", options.user); }
327+
if (options.n) formData.append("n", options.n);
328+
if (options.size) formData.append("size", options.size);
329+
if (options.user) formData.append("user", options.user);
330330
if (options.responseFormat) {
331331
formData.append("response_format", options.responseFormat);
332332
}

src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ export interface ChatCompletionStreamDelta {
723723
function_call?: {
724724
name?: string;
725725
arguments: string;
726-
}
726+
};
727727
}
728728

729729
export interface ChatCompletionStream {

0 commit comments

Comments
 (0)