Skip to content

Commit 286f8b2

Browse files
authored
[fix] format & lint (#1113)
woops
1 parent 560585e commit 286f8b2

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

packages/inference/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export type { ProviderMapping } from "./providers/types"
1+
export type { ProviderMapping } from "./providers/types";
22
export { HfInference, HfInferenceEndpoint } from "./HfInference";
33
export { InferenceOutputError } from "./lib/InferenceOutputError";
44
export { FAL_AI_SUPPORTED_MODEL_IDS } from "./providers/fal-ai";

packages/inference/src/lib/makeRequestOptions.ts

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -66,21 +66,21 @@ export async function makeRequestOptions(
6666
? "hf-token"
6767
: "provider-key"
6868
: includeCredentials === "include"
69-
? "credentials-include"
70-
: "none";
69+
? "credentials-include"
70+
: "none";
7171

7272
const url = endpointUrl
7373
? chatCompletion
7474
? endpointUrl + `/v1/chat/completions`
7575
: endpointUrl
7676
: makeUrl({
77-
authMethod,
78-
chatCompletion: chatCompletion ?? false,
79-
forceTask,
80-
model,
81-
provider: provider ?? "hf-inference",
82-
taskHint,
83-
});
77+
authMethod,
78+
chatCompletion: chatCompletion ?? false,
79+
forceTask,
80+
model,
81+
provider: provider ?? "hf-inference",
82+
taskHint,
83+
});
8484

8585
const headers: Record<string, string> = {};
8686
if (accessToken) {
@@ -134,9 +134,9 @@ export async function makeRequestOptions(
134134
body: binary
135135
? args.data
136136
: JSON.stringify({
137-
...otherArgs,
138-
...(chatCompletion || provider === "together" ? { model } : undefined),
139-
}),
137+
...otherArgs,
138+
...(chatCompletion || provider === "together" ? { model } : undefined),
139+
}),
140140
...(credentials ? { credentials } : undefined),
141141
signal: options?.signal,
142142
};
@@ -156,7 +156,8 @@ function mapModel(params: {
156156
if (!params.taskHint) {
157157
throw new Error("taskHint must be specified when using a third-party provider");
158158
}
159-
const task: WidgetType = params.taskHint === "text-generation" && params.chatCompletion ? "conversational" : params.taskHint;
159+
const task: WidgetType =
160+
params.taskHint === "text-generation" && params.chatCompletion ? "conversational" : params.taskHint;
160161
const model = (() => {
161162
switch (params.provider) {
162163
case "fal-ai":

0 commit comments

Comments
 (0)