mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-05-09 07:12:39 +02:00
fix api types
This commit is contained in:
parent
36135ed810
commit
5ef8321303
2 changed files with 6 additions and 9 deletions
|
|
@ -54,13 +54,10 @@ export async function POST(
|
||||||
}
|
}
|
||||||
|
|
||||||
// if workflow id is provided in the request, use it, else use the published workflow id
|
// if workflow id is provided in the request, use it, else use the published workflow id
|
||||||
let workflowId = result.data.workflowId;
|
let workflowId = result.data.workflowId ?? project.publishedWorkflowId;
|
||||||
if (!workflowId) {
|
if (!workflowId) {
|
||||||
workflowId = project.publishedWorkflowId;
|
logger.log(`No workflow id provided in request or project has no published workflow`);
|
||||||
}
|
return Response.json({ error: "No workflow id provided in request or project has no published workflow" }, { status: 404 });
|
||||||
if (!workflowId) {
|
|
||||||
logger.log(`Project ${projectId} has no published workflow`);
|
|
||||||
return Response.json({ error: "Project has no published workflow" }, { status: 404 });
|
|
||||||
}
|
}
|
||||||
// fetch workflow
|
// fetch workflow
|
||||||
const workflow = await agentWorkflowsCollection.findOne({
|
const workflow = await agentWorkflowsCollection.findOne({
|
||||||
|
|
|
||||||
|
|
@ -107,9 +107,9 @@ export const ApiMessage = z.union([
|
||||||
export const ApiRequest = z.object({
|
export const ApiRequest = z.object({
|
||||||
messages: z.array(ApiMessage),
|
messages: z.array(ApiMessage),
|
||||||
state: z.unknown(),
|
state: z.unknown(),
|
||||||
skipToolCalls: z.boolean().optional(),
|
skipToolCalls: z.boolean().nullable().optional(),
|
||||||
maxTurns: z.number().optional(),
|
maxTurns: z.number().nullable().optional(),
|
||||||
workflowId: z.string().optional(),
|
workflowId: z.string().nullable().optional(),
|
||||||
});
|
});
|
||||||
|
|
||||||
export const ApiResponse = z.object({
|
export const ApiResponse = z.object({
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue