UNPKG

@iqai/adk-cli

Version:

CLI tool for creating, running, and testing ADK-TS agents

86 lines 3.68 kB
"use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; var __param = (this && this.__param) || function (paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } }; Object.defineProperty(exports, "__esModule", { value: true }); exports.RunnerController = void 0; const common_1 = require("@nestjs/common"); const swagger_1 = require("@nestjs/swagger"); const api_dto_1 = require("../dto/api.dto"); const runner_service_1 = require("./runner.service"); let RunnerController = class RunnerController { runnerService; constructor(runnerService) { this.runnerService = runnerService; } async run(body) { return this.runnerService.run(body); } async runSSE(body, res) { return this.runnerService.runSSE(body, res); } }; exports.RunnerController = RunnerController; __decorate([ (0, common_1.Post)("run"), (0, swagger_1.ApiOperation)({ summary: "Execute agent and return all events", description: "Runs the agent with the provided message and returns all generated events at once.", }), (0, swagger_1.ApiBody)({ description: "Run request with agent, session, and message details", schema: { example: { appName: "my-agent", userId: "user123", sessionId: "session456", newMessage: { parts: [{ text: "Hello!" }] }, }, }, }), (0, swagger_1.ApiOkResponse)({ type: api_dto_1.EventsResponseDto }), __param(0, (0, common_1.Body)()), __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", Promise) ], RunnerController.prototype, "run", null); __decorate([ (0, common_1.Post)("run_sse"), (0, swagger_1.ApiOperation)({ summary: "Execute agent with Server-Sent Events streaming", description: "Runs the agent and streams events back via SSE for real-time updates.", }), (0, swagger_1.ApiBody)({ description: "Run request with optional streaming flag", schema: { example: { appName: "my-agent", userId: "user123", sessionId: "session456", newMessage: { parts: [{ text: "Hello!" }] }, streaming: true, }, }, }), __param(0, (0, common_1.Body)()), __param(1, (0, common_1.Res)()), __metadata("design:type", Function), __metadata("design:paramtypes", [Object, Object]), __metadata("design:returntype", Promise) ], RunnerController.prototype, "runSSE", null); exports.RunnerController = RunnerController = __decorate([ (0, swagger_1.ApiTags)("runner"), (0, common_1.Controller)(), __param(0, (0, common_1.Inject)(runner_service_1.RunnerService)), __metadata("design:paramtypes", [runner_service_1.RunnerService]) ], RunnerController); //# sourceMappingURL=runner.controller.js.map