You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

Stateless.cshtml.cs 998 B

12345678910111213141516171819202122232425262728293031323334
  1. using LLama.Web.Common;
  2. using LLama.Web.Models;
  3. using LLama.Web.Services;
  4. using Microsoft.AspNetCore.Mvc;
  5. using Microsoft.AspNetCore.Mvc.RazorPages;
  6. using Microsoft.Extensions.Options;
  7. namespace LLama.Web.Pages
  8. {
  9. public class StatelessModel : PageModel
  10. {
  11. private readonly ILogger<StatelessModel> _logger;
  12. private readonly ConnectionSessionService _modelSessionService;
  13. public StatelessModel(ILogger<StatelessModel> logger, IOptions<LLamaOptions> options, ConnectionSessionService modelSessionService)
  14. {
  15. _logger = logger;
  16. Options = options.Value;
  17. _modelSessionService = modelSessionService;
  18. }
  19. public LLamaOptions Options { get; set; }
  20. public void OnGet()
  21. {
  22. }
  23. public async Task<IActionResult> OnPostCancel(CancelModel model)
  24. {
  25. await _modelSessionService.CancelAsync(model.ConnectionId);
  26. return new JsonResult(default);
  27. }
  28. }
  29. }