mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-06-06 19:35:44 +02:00
Add data source ids to copilot request
This commit is contained in:
parent
9c712250fb
commit
462a2fb651
5 changed files with 70 additions and 13 deletions
|
|
@ -38,7 +38,24 @@ export async function getCopilotResponse(
|
|||
workflow_schema: JSON.stringify(zodToJsonSchema(CopilotWorkflow)),
|
||||
current_workflow_config: JSON.stringify(convertToCopilotWorkflow(current_workflow_config)),
|
||||
context: context ? convertToCopilotApiChatContext(context) : null,
|
||||
dataSources: dataSources ? dataSources.map(ds => CopilotDataSource.parse(ds)) : undefined,
|
||||
dataSources: dataSources ? dataSources.map(ds => {
|
||||
console.log('Original data source:', JSON.stringify(ds));
|
||||
// First parse to validate, then ensure _id is included
|
||||
CopilotDataSource.parse(ds); // validate but don't use the result
|
||||
// Cast to any to handle the WithStringId type
|
||||
const withId = ds as any;
|
||||
const result = {
|
||||
_id: withId._id,
|
||||
name: withId.name,
|
||||
description: withId.description,
|
||||
active: withId.active,
|
||||
status: withId.status,
|
||||
error: withId.error,
|
||||
data: withId.data
|
||||
};
|
||||
console.log('Processed data source:', JSON.stringify(result));
|
||||
return result;
|
||||
}) : undefined,
|
||||
};
|
||||
console.log(`sending copilot request`, JSON.stringify(request));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue