File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ M.init_provider = function(config)
9
9
assert (config .name , " config.name is required" )
10
10
assert (config .endpoint , " config.endpoint is required" )
11
11
assert (config .api_key , " config.api_key is required" )
12
- assert (config .models , " config.model or config.models required" )
12
+ assert (config .model or config . models , " config.model or config.models required" )
13
13
return MultiProvider :new (config )
14
14
end
15
15
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ local Job = require("plenary.job")
9
9
--- @field endpoint string
10
10
--- @field api_key string | table | function
11
11
--- @field model_endpoint string | table | function
12
- --- @field model string | table
12
+ --- @field models table
13
13
--- @field name string
14
14
--- @field headers function | table
15
15
--- @field preprocess_payload_func function
@@ -220,7 +220,11 @@ function MultiProvider:new(config)
220
220
self .endpoint = config .endpoint
221
221
self .model_endpoint = config .model_endpoint or " "
222
222
self .api_key = config .api_key
223
- self .models = config .model or config .models
223
+ if config .model then
224
+ self .models = type (config .model ) == " string" and { config .model } or config .model
225
+ else
226
+ self .models = config .models
227
+ end
224
228
225
229
-- Function overrides (use defaults if not provided)
226
230
self .headers = config .headers or defaults .headers
You can’t perform that action at this time.
0 commit comments