File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
packages/inference/src/providers Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 11import { BaseConversationalTask , BaseTextGenerationTask } from "./providerHelper" ;
2- import type { ChatCompletionOutput , TextGenerationOutputFinishReason } from "@huggingface/tasks" ;
2+ import type { ChatCompletionOutput , TextGenerationOutputFinishReason , TextGenerationOutput } from "@huggingface/tasks" ;
33import { InferenceOutputError } from "../lib/InferenceOutputError" ;
4+ import type { BodyParams } from "../types" ;
45
56interface 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}
You can’t perform that action at this time.
0 commit comments