Skip to content

Commit 903cace

Browse files
committed
🔧 address PR feedback
1 parent b4278bb commit 903cace

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packages/inference/src/providers/featherless-ai.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { BaseConversationalTask, BaseTextGenerationTask } from "./providerHelper";
2-
import type { ChatCompletionOutput, TextGenerationOutputFinishReason } from "@huggingface/tasks";
2+
import type { ChatCompletionOutput, TextGenerationOutputFinishReason, TextGenerationOutput } from "@huggingface/tasks";
33
import { InferenceOutputError } from "../lib/InferenceOutputError";
4+
import type { BodyParams } from "../types";
45

56
interface FeatherlessAITextCompletionOutput extends Omit<ChatCompletionOutput, "choices"> {
67
choices: Array<{
@@ -27,9 +28,9 @@ export class FeatherlessAITextGenerationTask extends BaseTextGenerationTask {
2728

2829
override preparePayload(params: BodyParams): Record<string, unknown> {
2930
return {
30-
model: params.model,
3131
...params.args,
32-
...params.args.parameters,
32+
...(params.args.parameters as Record<string, unknown>),
33+
model: params.model,
3334
prompt: params.args.inputs,
3435
};
3536
}
@@ -46,6 +47,6 @@ export class FeatherlessAITextGenerationTask extends BaseTextGenerationTask {
4647
generated_text: completion.text,
4748
};
4849
}
49-
throw new InferenceOutputError("Expected Together text generation response format");
50+
throw new InferenceOutputError("Expected Featherless AI text generation response format");
5051
}
5152
}

0 commit comments

Comments
 (0)