@@ -66,21 +66,21 @@ export async function makeRequestOptions(
66
66
? "hf-token"
67
67
: "provider-key"
68
68
: includeCredentials === "include"
69
- ? "credentials-include"
70
- : "none" ;
69
+ ? "credentials-include"
70
+ : "none" ;
71
71
72
72
const url = endpointUrl
73
73
? chatCompletion
74
74
? endpointUrl + `/v1/chat/completions`
75
75
: endpointUrl
76
76
: 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
+ } ) ;
84
84
85
85
const headers : Record < string , string > = { } ;
86
86
if ( accessToken ) {
@@ -134,9 +134,9 @@ export async function makeRequestOptions(
134
134
body : binary
135
135
? args . data
136
136
: JSON . stringify ( {
137
- ...otherArgs ,
138
- ...( chatCompletion || provider === "together" ? { model } : undefined ) ,
139
- } ) ,
137
+ ...otherArgs ,
138
+ ...( chatCompletion || provider === "together" ? { model } : undefined ) ,
139
+ } ) ,
140
140
...( credentials ? { credentials } : undefined ) ,
141
141
signal : options ?. signal ,
142
142
} ;
@@ -156,7 +156,8 @@ function mapModel(params: {
156
156
if ( ! params . taskHint ) {
157
157
throw new Error ( "taskHint must be specified when using a third-party provider" ) ;
158
158
}
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 ;
160
161
const model = ( ( ) => {
161
162
switch ( params . provider ) {
162
163
case "fal-ai" :
0 commit comments