1234567891011121314151617181920212223242526272829303132333435 |
- using HTEXGpt.Models;
- using HTEXGpt.Services;
- using Microsoft.AspNetCore.Mvc;
- using System.Diagnostics.Tracing;
- using System.Net;
- namespace HTEX.Screen.Controllers
- {
- [ProducesResponseType(StatusCodes.Status200OK)]
- [ProducesResponseType(StatusCodes.Status400BadRequest)]
- [Route("chat")]
- [ApiController]
- public class ChatController : ControllerBase
- {
- private static int _eventCounter = 0;
- private readonly IAiAppService _aiAppService;
- public ChatController(IAiAppService aiAppService)
- {
- _aiAppService=aiAppService;
- }
- /// <summary>
- /// 混元大模型
- /// SecretId:AKIDthPvHSSEnCTXNyVfjfWCvZVNLNJ8lBXi
- ///SecretKey:CKKA0e7MROFyY1JPQMD90kLl1JXnw20n
- /// </summary>
- /// <param name="dto"></param>
- /// <returns></returns>
- [HttpPost("message")]
- public async Task<IActionResult> Message(ChatRequest dto)
- {
- var chatResponse = await _aiAppService.ChatMessage(dto.modelType, dto, HttpContext, Response);
- return Ok(new { response = chatResponse });
- }
- }
- }
|