mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-23 08:58:26 +00:00
Merge pull request #13244 from ToolJet/fix/resolve-module-feedbacks
fix feedbacks
This commit is contained in:
commit
5e6f0fc99f
11 changed files with 8 additions and 71 deletions
|
|
@ -1 +1 @@
|
|||
Subproject commit 3297d4303806594bd3f5b614df9057c8ceaa92b3
|
||||
Subproject commit d5ff0d01362128917dbfa01972f871236438cdb3
|
||||
|
|
@ -4,7 +4,6 @@ import { fetchEventSource } from '@microsoft/fetch-event-source';
|
|||
|
||||
export const aiService = {
|
||||
generateApp,
|
||||
createComponent,
|
||||
createQuery,
|
||||
updateComponent,
|
||||
createEvent,
|
||||
|
|
@ -60,14 +59,6 @@ function generateApp(prompt) {
|
|||
return fetch(`${config.apiUrl}/ai/generateApp`, requestOptions).then(handleResponse);
|
||||
}
|
||||
|
||||
function createComponent(prompt) {
|
||||
const body = {
|
||||
prompt,
|
||||
};
|
||||
const requestOptions = { method: 'POST', headers: authHeader(), credentials: 'include', body: JSON.stringify(body) };
|
||||
return fetch(`${config.apiUrl}/agents/create-components`, requestOptions).then(handleResponse);
|
||||
}
|
||||
|
||||
function createQuery(prompt) {
|
||||
const body = {
|
||||
prompt,
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 1aaf0d63c9b55034503696a746167b3f32152360
|
||||
Subproject commit 1355aafd032a55f8b028d4996ec86e7ebdd4cb6e
|
||||
|
|
@ -1,16 +1,4 @@
|
|||
export interface IAgentsService {
|
||||
createComponent(prompt: string, organizationId: string): Promise<any>;
|
||||
|
||||
createQuery(prompt: string, tableName: string, columns: string, organizationId: string): Promise<any>;
|
||||
|
||||
createEvent(prompt: string, pageId: string[], organizationId: string): Promise<any>;
|
||||
|
||||
Agentic(prompt: string, organizationId: string): Promise<any>;
|
||||
|
||||
PromptEnrichment(prd_data: { content: string; metadata?: any }, organizationId: string): Promise<any>;
|
||||
|
||||
PromptEnrichmentChat(prompt: string, oldContext: any[], organizationId: string): Promise<any>;
|
||||
|
||||
CreateTable(organizationId: string, tables: any): Promise<any>;
|
||||
|
||||
docs(prompt: string, organizationId: string): Promise<any>;
|
||||
|
|
|
|||
|
|
@ -34,10 +34,6 @@ export interface IAiUtilService {
|
|||
|
||||
getQueriesfromsteps(steps: any): Promise<any>;
|
||||
|
||||
createQuerySteps(prd: string, lld: string, tableName: any, components: any, organizationId: any): Promise<any>;
|
||||
|
||||
createEventSteps(prd: string, Query: any, components: any, organizationId: any): Promise<any>;
|
||||
|
||||
convertToSteps(jsonData: any): Promise<any>;
|
||||
|
||||
getColorScheme(prd: any): any;
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import { AppPermissionsModule } from '@modules/app-permissions/module';
|
|||
import { ImportExportResourcesModule } from '@modules/import-export-resources/module';
|
||||
import { ArtifactRepository } from './repositories/artifact.repository';
|
||||
import { SubModule } from '@modules/app/sub-module';
|
||||
import { DataQueryRepository } from '@modules/data-queries/repository';
|
||||
|
||||
export class AiModule extends SubModule {
|
||||
static async register(configs: { IS_GET_CONTEXT: boolean }): Promise<DynamicModule> {
|
||||
|
|
@ -47,6 +48,7 @@ export class AiModule extends SubModule {
|
|||
AiResponseVoteRepository,
|
||||
FeatureAbilityFactory,
|
||||
ArtifactRepository,
|
||||
DataQueryRepository,
|
||||
|
||||
EventsService,
|
||||
],
|
||||
|
|
|
|||
|
|
@ -4,30 +4,6 @@ import { IAgentsService } from '../interfaces/IAgentsService';
|
|||
@Injectable()
|
||||
export class AgentsService implements IAgentsService {
|
||||
constructor() {}
|
||||
// Agents methods
|
||||
async createComponent(prompt: string, organizationId): Promise<any> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
async createQuery(prompt: string, tableName: string, columns: string, organizationId): Promise<any> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
async createEvent(prompt: string, pageId: string[], organizationId): Promise<any> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
async Agentic(prompt: string, organizationId): Promise<any> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
async PromptEnrichment(prd_data: { content: string; metadata?: any }, organizationId: string): Promise<any> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
async PromptEnrichmentChat(prompt: string, oldContext: any[], organizationId): Promise<any> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
async CreateTable(organizationId: string, tables): Promise<any> {
|
||||
throw new Error('Method not implemented.');
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { IAiUtilService } from './interfaces/IUtilService';
|
|||
|
||||
export class AiUtilService implements IAiUtilService {
|
||||
constructor() {}
|
||||
|
||||
|
||||
public getAgentAssetPath(filename) {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
|
@ -35,14 +35,6 @@ export class AiUtilService implements IAiUtilService {
|
|||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
async createQuerySteps(prd: string, lld: string, tableName, components, organizationId) {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
async createEventSteps(prd: string, Query: any, components: any, organizationId: any): Promise<any> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
async convertToSteps(jsonData: any): Promise<any> {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ export class DataQueriesModule extends SubModule {
|
|||
AppFeatureAbilityFactory,
|
||||
DataSourceFeatureAbilityFactory,
|
||||
],
|
||||
exports: [DataQueriesUtilService, DataQueriesService],
|
||||
exports: [DataQueriesUtilService],
|
||||
controllers: [DataQueriesController],
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ import { EntityManager, In } from 'typeorm';
|
|||
import { User } from 'src/entities/user.entity';
|
||||
import { DataSource } from 'src/entities/data_source.entity';
|
||||
import { dbTransactionWrap } from 'src/helpers/database.helper';
|
||||
import { DataSourceTypes } from '@modules/data-sources/constants';
|
||||
import { Response } from 'express';
|
||||
import { DataQueryRepository } from './repository';
|
||||
import { decode } from 'js-base64';
|
||||
|
|
@ -22,14 +21,7 @@ export class DataQueriesService implements IDataQueriesService {
|
|||
protected readonly dataQueryRepository: DataQueryRepository,
|
||||
protected readonly dataQueryUtilService: DataQueriesUtilService,
|
||||
protected readonly dataSourceRepository: DataSourcesRepository
|
||||
) { }
|
||||
|
||||
async findOne(dataQueryId: string): Promise<DataQuery> {
|
||||
return await this.dataQueryRepository.findOne({
|
||||
where: { id: dataQueryId },
|
||||
relations: ['dataSource', 'apps', 'dataSource.apps', 'plugins'],
|
||||
});
|
||||
}
|
||||
) {}
|
||||
|
||||
async getAll(user: User, versionId: string, mode?: string) {
|
||||
const queries = await this.dataQueryRepository.getAll(versionId);
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import { IComponentsController } from '../interfaces/controllers/IComponentsCont
|
|||
version: '2',
|
||||
})
|
||||
export class ComponentsController implements IComponentsController {
|
||||
constructor(protected readonly componentsService: ComponentsService) {}
|
||||
constructor(protected readonly componentsService: ComponentsService) { }
|
||||
|
||||
@InitFeature(FEATURE_KEY.CREATE_COMPONENTS)
|
||||
@UseGuards(JwtAuthGuard, ValidAppGuard, FeatureAbilityGuard)
|
||||
|
|
|
|||
Loading…
Reference in a new issue