set default roles for json as well
git push
This commit is contained in:
parent
6e21873488
commit
41785c920c
3 changed files with 18 additions and 7 deletions
|
|
@ -326,6 +326,7 @@ async function intermediateToFinalConfig(
|
|||
...model.requestOptions,
|
||||
...config.requestOptions,
|
||||
};
|
||||
model.roles = model.roles ?? ["chat"]; // Default to chat role if not specified
|
||||
}
|
||||
|
||||
if (allowFreeTrial) {
|
||||
|
|
|
|||
|
|
@ -235,13 +235,15 @@ function ModelSelect() {
|
|||
|
||||
useEffect(() => {
|
||||
setOptions(
|
||||
allModels.map((model) => {
|
||||
return {
|
||||
value: model.title,
|
||||
title: modelSelectTitle(model),
|
||||
apiKey: model.apiKey,
|
||||
};
|
||||
}),
|
||||
allModels
|
||||
.filter((m) => !m.roles || m.roles.includes("chat"))
|
||||
.map((model) => {
|
||||
return {
|
||||
value: model.title,
|
||||
title: modelSelectTitle(model),
|
||||
apiKey: model.apiKey,
|
||||
};
|
||||
}),
|
||||
);
|
||||
}, [allModels]);
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,14 @@ export default defineConfig({
|
|||
},
|
||||
},
|
||||
},
|
||||
server: {
|
||||
cors: {
|
||||
origin: "*",
|
||||
methods: ["GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS"],
|
||||
allowedHeaders: ["*", "Content-Type", "Authorization"],
|
||||
credentials: true,
|
||||
},
|
||||
},
|
||||
test: {
|
||||
globals: true,
|
||||
environment: "jsdom",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue