mirror of
https://github.com/HeyPuter/puter.git
synced 2026-05-19 22:58:32 -05:00
dev: disallow "auto" model
This model seems to cause us problems
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
*/
|
||||
|
||||
// METADATA // {"ai-commented":{"service":"claude"}}
|
||||
const APIError = require("../../api/APIError");
|
||||
const BaseService = require("../../services/BaseService");
|
||||
const OpenAIUtil = require("./lib/OpenAIUtil");
|
||||
|
||||
@@ -122,6 +123,14 @@ class OpenRouterService extends BaseService {
|
||||
if ( model.startsWith('openrouter:') ) {
|
||||
model = model.slice('openrouter:'.length);
|
||||
}
|
||||
|
||||
if ( model === 'openrouter/auto' ) {
|
||||
throw APIError.create('field_invalid', null, {
|
||||
key: 'model',
|
||||
expected: 'allowed model',
|
||||
got: 'disallowed model',
|
||||
})
|
||||
}
|
||||
|
||||
messages = await OpenAIUtil.process_input_messages(messages);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user