feat(server): add fallback model and baseurl in schema (#13375)

fix AI-398

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Added support for specifying fallback models for multiple AI
providers, enhancing reliability when primary models are unavailable.
* Providers can now fetch and update their list of available models
dynamically from external APIs.
* Configuration options expanded to allow custom base URLs for certain
providers.

* **Bug Fixes**
* Improved model selection logic to use fallback models if the requested
model is not available online.

* **Chores**
* Updated backend dependencies to include authentication support for
Google services.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
DarkSky
2025-08-01 15:22:48 +08:00
committed by GitHub
parent 19790c1b9e
commit 5cbcf6f907
14 changed files with 544 additions and 69 deletions
+22 -21
View File
@@ -998,6 +998,7 @@ __metadata:
express: "npm:^5.0.1"
fast-xml-parser: "npm:^5.0.0"
get-stream: "npm:^9.0.1"
google-auth-library: "npm:^10.2.0"
graphql: "npm:^16.9.0"
graphql-scalars: "npm:^1.24.0"
graphql-upload: "npm:^17.0.0"
@@ -22147,14 +22148,14 @@ __metadata:
languageName: node
linkType: hard
"gaxios@npm:^7.0.0-rc.1, gaxios@npm:^7.0.0-rc.4":
version: 7.0.0-rc.6
resolution: "gaxios@npm:7.0.0-rc.6"
"gaxios@npm:^7.0.0, gaxios@npm:^7.0.0-rc.4":
version: 7.1.1
resolution: "gaxios@npm:7.1.1"
dependencies:
extend: "npm:^3.0.2"
https-proxy-agent: "npm:^7.0.1"
node-fetch: "npm:^3.3.2"
checksum: 10/60c688d4c65062c97bf0f33f959713df106e207065586bf5deb546ef5d02cddcba46d138c0b7eb8712950ca880fa28d3665936b19156224f8c478d9c4f817aea
checksum: 10/9e5fa8b458c318a95d4dff0f6ac187a1b8933fb1de5b376b7098b27dfc5bf6025b62c87ed20bdae0496ae73a279834bc6b974c28849a674deed0089f2ba57b98
languageName: node
linkType: hard
@@ -22169,14 +22170,14 @@ __metadata:
languageName: node
linkType: hard
"gcp-metadata@npm:^7.0.0-rc.1":
version: 7.0.0-rc.1
resolution: "gcp-metadata@npm:7.0.0-rc.1"
"gcp-metadata@npm:^7.0.0":
version: 7.0.1
resolution: "gcp-metadata@npm:7.0.1"
dependencies:
gaxios: "npm:^7.0.0-rc.1"
gaxios: "npm:^7.0.0"
google-logging-utils: "npm:^1.0.0"
json-bigint: "npm:^1.0.0"
checksum: 10/2c58401c7945c41144bc6a44a066c050d36c34ee10e04e85ffde488afec6a3f67ebe29e697d0328aa20181b38a36aae9165896c0201387ea8cff031cdb790ab9
checksum: 10/c82f20a4ce22278998fe033e668a66bff04d2b3e95e19f968adeac829e12274e07b453fcfcf34573a6d702b3570c5556cba6eb6b59d1c03757c866e3271972c1
languageName: node
linkType: hard
@@ -22540,18 +22541,18 @@ __metadata:
languageName: node
linkType: hard
"google-auth-library@npm:^10.0.0-rc.1":
version: 10.0.0-rc.3
resolution: "google-auth-library@npm:10.0.0-rc.3"
"google-auth-library@npm:^10.0.0-rc.1, google-auth-library@npm:^10.2.0":
version: 10.2.0
resolution: "google-auth-library@npm:10.2.0"
dependencies:
base64-js: "npm:^1.3.0"
ecdsa-sig-formatter: "npm:^1.0.11"
gaxios: "npm:^7.0.0-rc.4"
gcp-metadata: "npm:^7.0.0-rc.1"
gaxios: "npm:^7.0.0"
gcp-metadata: "npm:^7.0.0"
google-logging-utils: "npm:^1.0.0"
gtoken: "npm:^8.0.0-rc.1"
gtoken: "npm:^8.0.0"
jws: "npm:^4.0.0"
checksum: 10/d76f470ddba1d5ec84cb72b03af388722db2987a95f64c7d91169f3f67608528a327fd132bb00d74be10b08e6446906b16983cf0aa9f6fa10ac7a6d3aacff0d7
checksum: 10/dfa6ad7240da3915b7e15d1f39cd6906e6714502b09957be07d2429665a44c6b46d8ca7a077cec7fcb83f82ed2c3cb5a9b7c1ba79ebb3e8920eba286a24bdd63
languageName: node
linkType: hard
@@ -22748,13 +22749,13 @@ __metadata:
languageName: node
linkType: hard
"gtoken@npm:^8.0.0-rc.1":
version: 8.0.0-rc.1
resolution: "gtoken@npm:8.0.0-rc.1"
"gtoken@npm:^8.0.0":
version: 8.0.0
resolution: "gtoken@npm:8.0.0"
dependencies:
gaxios: "npm:^7.0.0-rc.1"
gaxios: "npm:^7.0.0"
jws: "npm:^4.0.0"
checksum: 10/d2481344df8d9f62ec3ae7fe97b562c93dc294c7d1e7d8e1603162fe2726cfb5993f2b1a4e04388ee0f49c5fd02c1b0799dc58cebbf8af10489af8de80a72902
checksum: 10/b921430395dcd06ee63c3fc5a5e339ca4d6dcb38b6d618beb0f260bae1088d53d130f86029a9d578f1601c64685f49a65dba57bbd617c4b14039180b67b6c5ce
languageName: node
linkType: hard