Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ export class GeneratePanelPositionWithAiDs {
masterPassword: string;
userId: string;
chart_description: string;
table_name: string;
name?: string;
position_x?: number;
position_y?: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ import {
Param,
Post,
Put,
Query,
UseGuards,
UseInterceptors,
} from '@nestjs/common';
import { ApiBearerAuth, ApiBody, ApiOperation, ApiParam, ApiQuery, ApiResponse, ApiTags } from '@nestjs/swagger';
import { ApiBearerAuth, ApiBody, ApiOperation, ApiParam, ApiResponse, ApiTags } from '@nestjs/swagger';
import { UseCaseType } from '../../../common/data-injection.tokens.js';
import { MasterPassword } from '../../../decorators/master-password.decorator.js';
import { SlugUuid } from '../../../decorators/slug-uuid.decorator.js';
Expand Down Expand Up @@ -157,7 +156,7 @@ export class DashboardWidgetController {
@ApiOperation({
summary: 'Generate a panel using AI',
description:
'Creates a new panel with SQL query and chart configuration generated by AI based on natural language description',
'Creates a new panel with SQL query and chart configuration generated by AI based on natural language description. AI autonomously discovers relevant tables.',
})
@ApiResponse({
status: 201,
Expand All @@ -167,13 +166,12 @@ export class DashboardWidgetController {
@ApiBody({ type: GeneratePanelPositionWithAiDto })
@ApiParam({ name: 'dashboardId', required: true })
@ApiParam({ name: 'connectionId', required: true })
@ApiQuery({ name: 'tableName', required: true, description: 'The table name to generate the panel for' })
@UseGuards(ConnectionEditGuard)
@Timeout(TimeoutDefaults.AI)
@Post('/dashboard/:dashboardId/widget/generate/:connectionId')
async generateWidgetWithAi(
@SlugUuid('connectionId') connectionId: string,
@Param('dashboardId') dashboardId: string,
@Query('tableName') tableName: string,
@MasterPassword() masterPwd: string,
@UserId() userId: string,
@Body() generateDto: GeneratePanelPositionWithAiDto,
Expand All @@ -184,7 +182,6 @@ export class DashboardWidgetController {
masterPassword: masterPwd,
userId,
chart_description: generateDto.chart_description,
table_name: tableName,
name: generateDto.name,
};
return await this.generateWidgetWithAiUseCase.execute(inputData, InTransactionEnum.OFF);
Expand Down
Loading
Loading