Show / Hide Table of Contents

Class LLMController

Controller for the REST API interface on LLM conversations.

Inheritance
object
ControllerBase
LLMController
Inherited Members
ControllerBase.StatusCode(int)
ControllerBase.StatusCode(int, object)
ControllerBase.Content(string)
ControllerBase.Content(string, string)
ControllerBase.Content(string, string, Encoding)
ControllerBase.Content(string, MediaTypeHeaderValue)
ControllerBase.NoContent()
ControllerBase.Ok()
ControllerBase.Ok(object)
ControllerBase.Redirect(string)
ControllerBase.RedirectPermanent(string)
ControllerBase.RedirectPreserveMethod(string)
ControllerBase.RedirectPermanentPreserveMethod(string)
ControllerBase.LocalRedirect(string)
ControllerBase.LocalRedirectPermanent(string)
ControllerBase.LocalRedirectPreserveMethod(string)
ControllerBase.LocalRedirectPermanentPreserveMethod(string)
ControllerBase.RedirectToAction()
ControllerBase.RedirectToAction(string)
ControllerBase.RedirectToAction(string, object)
ControllerBase.RedirectToAction(string, string)
ControllerBase.RedirectToAction(string, string, object)
ControllerBase.RedirectToAction(string, string, string)
ControllerBase.RedirectToAction(string, string, object, string)
ControllerBase.RedirectToActionPreserveMethod(string, string, object, string)
ControllerBase.RedirectToActionPermanent(string)
ControllerBase.RedirectToActionPermanent(string, object)
ControllerBase.RedirectToActionPermanent(string, string)
ControllerBase.RedirectToActionPermanent(string, string, string)
ControllerBase.RedirectToActionPermanent(string, string, object)
ControllerBase.RedirectToActionPermanent(string, string, object, string)
ControllerBase.RedirectToActionPermanentPreserveMethod(string, string, object, string)
ControllerBase.RedirectToRoute(string)
ControllerBase.RedirectToRoute(object)
ControllerBase.RedirectToRoute(string, object)
ControllerBase.RedirectToRoute(string, string)
ControllerBase.RedirectToRoute(string, object, string)
ControllerBase.RedirectToRoutePreserveMethod(string, object, string)
ControllerBase.RedirectToRoutePermanent(string)
ControllerBase.RedirectToRoutePermanent(object)
ControllerBase.RedirectToRoutePermanent(string, object)
ControllerBase.RedirectToRoutePermanent(string, string)
ControllerBase.RedirectToRoutePermanent(string, object, string)
ControllerBase.RedirectToRoutePermanentPreserveMethod(string, object, string)
ControllerBase.RedirectToPage(string)
ControllerBase.RedirectToPage(string, object)
ControllerBase.RedirectToPage(string, string)
ControllerBase.RedirectToPage(string, string, object)
ControllerBase.RedirectToPage(string, string, string)
ControllerBase.RedirectToPage(string, string, object, string)
ControllerBase.RedirectToPagePermanent(string)
ControllerBase.RedirectToPagePermanent(string, object)
ControllerBase.RedirectToPagePermanent(string, string)
ControllerBase.RedirectToPagePermanent(string, string, string)
ControllerBase.RedirectToPagePermanent(string, string, object, string)
ControllerBase.RedirectToPagePreserveMethod(string, string, object, string)
ControllerBase.RedirectToPagePermanentPreserveMethod(string, string, object, string)
ControllerBase.File(byte[], string)
ControllerBase.File(byte[], string, bool)
ControllerBase.File(byte[], string, string)
ControllerBase.File(byte[], string, string, bool)
ControllerBase.File(byte[], string, DateTimeOffset?, EntityTagHeaderValue)
ControllerBase.File(byte[], string, DateTimeOffset?, EntityTagHeaderValue, bool)
ControllerBase.File(byte[], string, string, DateTimeOffset?, EntityTagHeaderValue)
ControllerBase.File(byte[], string, string, DateTimeOffset?, EntityTagHeaderValue, bool)
ControllerBase.File(Stream, string)
ControllerBase.File(Stream, string, bool)
ControllerBase.File(Stream, string, string)
ControllerBase.File(Stream, string, string, bool)
ControllerBase.File(Stream, string, DateTimeOffset?, EntityTagHeaderValue)
ControllerBase.File(Stream, string, DateTimeOffset?, EntityTagHeaderValue, bool)
ControllerBase.File(Stream, string, string, DateTimeOffset?, EntityTagHeaderValue)
ControllerBase.File(Stream, string, string, DateTimeOffset?, EntityTagHeaderValue, bool)
ControllerBase.File(string, string)
ControllerBase.File(string, string, bool)
ControllerBase.File(string, string, string)
ControllerBase.File(string, string, string, bool)
ControllerBase.File(string, string, DateTimeOffset?, EntityTagHeaderValue)
ControllerBase.File(string, string, DateTimeOffset?, EntityTagHeaderValue, bool)
ControllerBase.File(string, string, string, DateTimeOffset?, EntityTagHeaderValue)
ControllerBase.File(string, string, string, DateTimeOffset?, EntityTagHeaderValue, bool)
ControllerBase.PhysicalFile(string, string)
ControllerBase.PhysicalFile(string, string, bool)
ControllerBase.PhysicalFile(string, string, string)
ControllerBase.PhysicalFile(string, string, string, bool)
ControllerBase.PhysicalFile(string, string, DateTimeOffset?, EntityTagHeaderValue)
ControllerBase.PhysicalFile(string, string, DateTimeOffset?, EntityTagHeaderValue, bool)
ControllerBase.PhysicalFile(string, string, string, DateTimeOffset?, EntityTagHeaderValue)
ControllerBase.PhysicalFile(string, string, string, DateTimeOffset?, EntityTagHeaderValue, bool)
ControllerBase.Unauthorized()
ControllerBase.Unauthorized(object)
ControllerBase.NotFound()
ControllerBase.NotFound(object)
ControllerBase.BadRequest()
ControllerBase.BadRequest(object)
ControllerBase.BadRequest(ModelStateDictionary)
ControllerBase.UnprocessableEntity()
ControllerBase.UnprocessableEntity(object)
ControllerBase.UnprocessableEntity(ModelStateDictionary)
ControllerBase.Conflict()
ControllerBase.Conflict(object)
ControllerBase.Conflict(ModelStateDictionary)
ControllerBase.Problem(string, string, int?, string, string)
ControllerBase.ValidationProblem(ValidationProblemDetails)
ControllerBase.ValidationProblem(ModelStateDictionary)
ControllerBase.ValidationProblem()
ControllerBase.ValidationProblem(string, string, int?, string, string, ModelStateDictionary)
ControllerBase.Created()
ControllerBase.Created(string, object)
ControllerBase.Created(Uri, object)
ControllerBase.CreatedAtAction(string, object)
ControllerBase.CreatedAtAction(string, object, object)
ControllerBase.CreatedAtAction(string, string, object, object)
ControllerBase.CreatedAtRoute(string, object)
ControllerBase.CreatedAtRoute(object, object)
ControllerBase.CreatedAtRoute(string, object, object)
ControllerBase.Accepted()
ControllerBase.Accepted(object)
ControllerBase.Accepted(Uri)
ControllerBase.Accepted(string)
ControllerBase.Accepted(string, object)
ControllerBase.Accepted(Uri, object)
ControllerBase.AcceptedAtAction(string)
ControllerBase.AcceptedAtAction(string, string)
ControllerBase.AcceptedAtAction(string, object)
ControllerBase.AcceptedAtAction(string, string, object)
ControllerBase.AcceptedAtAction(string, object, object)
ControllerBase.AcceptedAtAction(string, string, object, object)
ControllerBase.AcceptedAtRoute(object)
ControllerBase.AcceptedAtRoute(string)
ControllerBase.AcceptedAtRoute(string, object)
ControllerBase.AcceptedAtRoute(object, object)
ControllerBase.AcceptedAtRoute(string, object, object)
ControllerBase.Challenge()
ControllerBase.Challenge(params string[])
ControllerBase.Challenge(AuthenticationProperties)
ControllerBase.Challenge(AuthenticationProperties, params string[])
ControllerBase.Forbid()
ControllerBase.Forbid(params string[])
ControllerBase.Forbid(AuthenticationProperties)
ControllerBase.Forbid(AuthenticationProperties, params string[])
ControllerBase.SignIn(ClaimsPrincipal)
ControllerBase.SignIn(ClaimsPrincipal, string)
ControllerBase.SignIn(ClaimsPrincipal, AuthenticationProperties)
ControllerBase.SignIn(ClaimsPrincipal, AuthenticationProperties, string)
ControllerBase.SignOut()
ControllerBase.SignOut(AuthenticationProperties)
ControllerBase.SignOut(params string[])
ControllerBase.SignOut(AuthenticationProperties, params string[])
ControllerBase.TryUpdateModelAsync<TModel>(TModel)
ControllerBase.TryUpdateModelAsync<TModel>(TModel, string)
ControllerBase.TryUpdateModelAsync<TModel>(TModel, string, IValueProvider)
ControllerBase.TryUpdateModelAsync<TModel>(TModel, string, params Expression<Func<TModel, object>>[])
ControllerBase.TryUpdateModelAsync<TModel>(TModel, string, Func<ModelMetadata, bool>)
ControllerBase.TryUpdateModelAsync<TModel>(TModel, string, IValueProvider, params Expression<Func<TModel, object>>[])
ControllerBase.TryUpdateModelAsync<TModel>(TModel, string, IValueProvider, Func<ModelMetadata, bool>)
ControllerBase.TryUpdateModelAsync(object, Type, string)
ControllerBase.TryUpdateModelAsync(object, Type, string, IValueProvider, Func<ModelMetadata, bool>)
ControllerBase.TryValidateModel(object)
ControllerBase.TryValidateModel(object, string)
ControllerBase.HttpContext
ControllerBase.Request
ControllerBase.Response
ControllerBase.RouteData
ControllerBase.ModelState
ControllerBase.ControllerContext
ControllerBase.MetadataProvider
ControllerBase.ModelBinderFactory
ControllerBase.Url
ControllerBase.ObjectValidator
ControllerBase.ProblemDetailsFactory
ControllerBase.User
ControllerBase.Empty
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Quantellia.WMServer.Asset.Controllers
Assembly: WMServer.dll
Syntax
[Route("llm")]
[Authorize]
[ApiController]
public class LLMController : ControllerBase

Constructors

LLMController(WMAppDbContext)

Constructor that injects the database context.

Declaration
public LLMController(WMAppDbContext context)
Parameters
Type Name Description
WMAppDbContext context

Methods

AssociateDocumentIndex(string, string)

Associate a VectorIndex and LLM for use in RAG

Declaration
[HttpPut("vectorindex/{documentIndexDir}/associate/{LLMDir}")]
public Task<IActionResult> AssociateDocumentIndex(string LLMDir, string documentIndexDir)
Parameters
Type Name Description
string LLMDir

The LLM ID

string documentIndexDir

The VectorIndex ID

Returns
Type Description
Task<IActionResult>

Delete(string)

Delete an existing instance of a LLM

Declaration
[HttpDelete("{id}")]
public Task<IActionResult> Delete(string id)
Parameters
Type Name Description
string id
Returns
Type Description
Task<IActionResult>

DeleteVectorDB(string)

Delete an existing instance of a Vector Index

Declaration
[HttpDelete("vectorindex/{id}")]
public Task<IActionResult> DeleteVectorDB(string id)
Parameters
Type Name Description
string id

The Vector Index ID

Returns
Type Description
Task<IActionResult>

DisassociateDocumentIndex(string, string)

Disassociate a VectorIndex and LLM for use in RAG

Declaration
[HttpDelete("vectorindex/{documentIndexDir}/disassociate/{LLMDir}")]
public Task<IActionResult> DisassociateDocumentIndex(string LLMDir, string documentIndexDir)
Parameters
Type Name Description
string LLMDir

The LLM ID

string documentIndexDir

The VectorIndex ID

Returns
Type Description
Task<IActionResult>

EndConversation(string)

Ends the conversation given by the supplied ID.

Declaration
[HttpPut("/llmConversation/{id}/close")]
public Task<IActionResult> EndConversation(string id)
Parameters
Type Name Description
string id

The ID of the conversation to be ended.

Returns
Type Description
Task<IActionResult>

Get()

Get the list of LLMs owned by the current user.

Declaration
[HttpGet]
public Task<ActionResult<IEnumerable<OpenDILLM>>> Get()
Returns
Type Description
Task<ActionResult<IEnumerable<OpenDILLM>>>

Get(string)

Get the LLM with the specified ID

Declaration
[HttpGet("{id}")]
public Task<ActionResult<OpenDILLM>> Get(string id)
Parameters
Type Name Description
string id
Returns
Type Description
Task<ActionResult<OpenDILLM>>

GetAPIKey(string)

Get the LLM with the specified ID's API Key

Declaration
[HttpGet("{id}/apikey")]
public Task<ActionResult<OpenDIDataSource>> GetAPIKey(string id)
Parameters
Type Name Description
string id
Returns
Type Description
Task<ActionResult<OpenDIDataSource>>

GetAssociatedVectorDBs(string)

Get all VectorDBs associated to the input LLM

Declaration
[HttpGet("vectorindex/associated/{id}")]
public Task<IActionResult> GetAssociatedVectorDBs(string id)
Parameters
Type Name Description
string id

The LLM ID

Returns
Type Description
Task<IActionResult>

GetDocuments(string)

Get all of the documents associated with this vector index.

Declaration
[HttpGet("vectorindex/{id}/documents")]
public Task<IActionResult> GetDocuments(string id)
Parameters
Type Name Description
string id

The VectorIndex ID

Returns
Type Description
Task<IActionResult>

GetVectorDB()

Get the list of Vector Indices owned by the current user.

Declaration
[HttpGet("vectorindex")]
public Task<ActionResult<IEnumerable<OpenDIDocumentIndex>>> GetVectorDB()
Returns
Type Description
Task<ActionResult<IEnumerable<OpenDIDocumentIndex>>>

GetVectorDB(string)

Get the Vector Index with the specified ID

Declaration
[HttpGet("vectorindex/{id}")]
public Task<ActionResult<OpenDIDocumentIndex>> GetVectorDB(string id)
Parameters
Type Name Description
string id

The Vector Index ID

Returns
Type Description
Task<ActionResult<OpenDIDocumentIndex>>

Insert(string, string)

Insert a Document into the VectorIndex for indexing.

Declaration
[HttpPut("vectorindex/{documentIndexDir}/insert/{documentDir}")]
public Task<IActionResult> Insert(string documentIndexDir, string documentDir)
Parameters
Type Name Description
string documentIndexDir

The VectorIndex ID/DIr

string documentDir

The Document ID/Dir

Returns
Type Description
Task<IActionResult>

InsertMany(string, ManyDocumentArgs)

Inserts a set of Documents into the VectorIndex for indexing.

Declaration
[HttpPut("vectorindex/{documentIndexDir}/insertmany")]
public Task<IActionResult> InsertMany(string documentIndexDir, ManyDocumentArgs documentArgs)
Parameters
Type Name Description
string documentIndexDir

The VectorIndex ID/DIr

ManyDocumentArgs documentArgs

The set of Document IDs/Dirs

Returns
Type Description
Task<IActionResult>

Post(OpenDILLM)

Create a new instance of a LLM

Declaration
[HttpPost]
public Task<ActionResult<OpenDILLM>> Post(OpenDILLM openDI_m)
Parameters
Type Name Description
OpenDILLM openDI_m
Returns
Type Description
Task<ActionResult<OpenDILLM>>

PostVectorDB(OpenDIDocumentIndex)

Create a new instance of a Vector Index

Declaration
[HttpPost("vectorindex")]
public Task<ActionResult<OpenDIDocumentIndex>> PostVectorDB(OpenDIDocumentIndex openDI_m)
Parameters
Type Name Description
OpenDIDocumentIndex openDI_m
Returns
Type Description
Task<ActionResult<OpenDIDocumentIndex>>

Put(string, OpenDILLM)

Update an existing instance of a LLM

Declaration
[HttpPut("{id}")]
public Task<IActionResult> Put(string id, OpenDILLM openDI_m)
Parameters
Type Name Description
string id
OpenDILLM openDI_m
Returns
Type Description
Task<IActionResult>

PutVectorDB(string, OpenDIDocumentIndex)

Update an existing instance of a Vector Index

Declaration
[HttpPut("vectorindex/{id}")]
public Task<IActionResult> PutVectorDB(string id, OpenDIDocumentIndex openDI_m)
Parameters
Type Name Description
string id

The Vector Index ID

OpenDIDocumentIndex openDI_m
Returns
Type Description
Task<IActionResult>

Query(string, MessageBody)

Query an LLM for contextually similar fragments stored in accessible vector indices.

Declaration
[HttpPut("vectorindex/query/{LLMID}")]
public Task<ActionResult<IEnumerable<string>>> Query(string LLMID, LLMController.MessageBody message)
Parameters
Type Name Description
string LLMID

The LLM ID

LLMController.MessageBody message

The message to insert

Returns
Type Description
Task<ActionResult<IEnumerable<string>>>

Remove(string, string)

Remove a document from the VectorIndex

Declaration
[HttpDelete("vectorindex/{documentIndexDir}/remove/{documentDir}")]
public Task<IActionResult> Remove(string documentIndexDir, string documentDir)
Parameters
Type Name Description
string documentIndexDir

The VectorIndex ID/DIr

string documentDir

The Document ID/Dir

Returns
Type Description
Task<IActionResult>

RemoveMany(string, ManyDocumentArgs)

Removes a set of documents from the VectorIndex

Declaration
[HttpDelete("vectorindex/{documentIndexDir}/removemany")]
public Task<IActionResult> RemoveMany(string documentIndexDir, ManyDocumentArgs documentArgs)
Parameters
Type Name Description
string documentIndexDir

The VectorIndex ID/DIr

ManyDocumentArgs documentArgs

The set of Document IDs/Dirs

Returns
Type Description
Task<IActionResult>

StreamConversation(ConversationArgs)

Utilizes a RAG architectured LLM to provide insights given the sent message, and message history.

Declaration
[HttpPost("/llmConversation")]
public Task StreamConversation(ConversationArgs args)
Parameters
Type Name Description
ConversationArgs args

A ConversationArgs object specifying the conversation ID and message.

Returns
Type Description
Task

A stream of response messages from the LLM provider

In this article
Back to top Copyright © 2025 Quantellia LLC.    Version 2.0.0 Revision 399     Last Updated 1/15/2025    DRAFT DOCUMENTATION. SUBJECT TO CHANGE