mirror of
https://github.com/HeyPuter/puter.git
synced 2026-09-22 21:26:04 +00:00
fix: fallback behavior related to fake-chat service
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test (18.x) (push) Has been cancelled
test / test (20.x) (push) Has been cancelled
test / test (22.x) (push) Has been cancelled
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test (18.x) (push) Has been cancelled
test / test (20.x) (push) Has been cancelled
test / test (22.x) (push) Has been cancelled
Fallbacks from or to the fake-chat service should not be allowed. Fallbacks to the "costly" model from fake-chat could result in unintended charges and fallbacks to real models from fake-chat could result in service abuse.
This commit is contained in:
@@ -474,6 +474,11 @@ class AIChatService extends BaseService {
|
||||
error: e,
|
||||
});
|
||||
while ( !! error ) {
|
||||
// No fallbacks for pseudo-models
|
||||
if ( intended_service === 'fake-chat' ) {
|
||||
break;
|
||||
}
|
||||
|
||||
const fallback = this.get_fallback_model({
|
||||
model, tried,
|
||||
});
|
||||
@@ -845,6 +850,7 @@ class AIChatService extends BaseService {
|
||||
|
||||
for ( const model of sorted_models ) {
|
||||
if ( tried.includes(model.id) ) continue;
|
||||
if ( model.provider === 'fake-chat' ) continue;
|
||||
|
||||
return {
|
||||
fallback_service_name: model.provider,
|
||||
|
||||
Reference in New Issue
Block a user