using Microsoft.AspNetCore.Mvc; using ChatbotApi.Data.Models; using Microsoft.AspNetCore.RateLimiting; using System.Runtime.CompilerServices; using ChatbotApi.Services; namespace ChatbotApi.Controllers { [ApiController] [Route("api/[controller]")] public class ChatController : ControllerBase { private readonly IChatService _chatService; private readonly ILogger _logger; public ChatController(IChatService chatService, ILogger logger) { _chatService = chatService; _logger = logger; } [HttpPost("stream-message")] [EnableRateLimiting("fixed")] public IAsyncEnumerable StreamMessage( [FromBody] ChatRequest request, CancellationToken cancellationToken) { return _chatService.StreamMessageAsync(request, cancellationToken); } } }