mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-05-08 06:42:39 +02:00
Fix prebuilt cards model configuration (#261)
- Set all prebuilt card models to blank ("model": "")
- Add model fallback in createProjectFromWorkflowJson to use PROVIDER_DEFAULT_MODEL
- Enables different models for OSS vs managed deployments via environment variable
This commit is contained in:
parent
1072c8836c
commit
cbcc1aa8a6
11 changed files with 45 additions and 33 deletions
|
|
@ -97,12 +97,24 @@ export async function createProjectFromWorkflowJson(formData: FormData): Promise
|
|||
const workflowJson = formData.get('workflowJson') as string;
|
||||
|
||||
try {
|
||||
// Parse workflow and apply default model to blank agent models
|
||||
const workflow = JSON.parse(workflowJson);
|
||||
const defaultModel = process.env.PROVIDER_DEFAULT_MODEL || 'gpt-4o';
|
||||
|
||||
if (workflow.agents && Array.isArray(workflow.agents)) {
|
||||
workflow.agents.forEach((agent: any) => {
|
||||
if (agent.model === '') {
|
||||
agent.model = defaultModel;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const project = await createProjectController.execute({
|
||||
userId: user.id,
|
||||
data: {
|
||||
name: name || '',
|
||||
mode: {
|
||||
workflowJson,
|
||||
workflowJson: JSON.stringify(workflow),
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue