24 lines
535 B
C#
24 lines
535 B
C#
using LLMApi.Services;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace LLMApi.Controllers;
|
|
|
|
[ApiController]
|
|
[Route("[controller]")]
|
|
public class LLMController : ControllerBase
|
|
{
|
|
private readonly ILlmApiService _apiService;
|
|
|
|
public LLMController(ILlmApiService apiService)
|
|
{
|
|
_apiService = apiService;
|
|
}
|
|
|
|
[HttpGet(nameof(AnswerToPrompt))]
|
|
public async Task<IActionResult> AnswerToPrompt(string prompt = "")
|
|
{
|
|
var temp = await _apiService.GetAnswerToPrompt(prompt);
|
|
|
|
return Ok(temp);
|
|
}
|
|
} |