LlmTransformationContext

Lib~ LlmTransformationContext

The Bots LlmTransformationContext is a class with convenience methods for transforming the request and response of LLM REST services

A LlmTransformationContext class instance is passed as an argument to every rest service event handler function.

Constructor

new LlmTransformationContext(request)

Description:
  • Constructor of rest service context. DO NOT USE - INSTANCE IS ALREADY PASSED TO EVENT HANDLERS
Source:
Parameters:
Name Type Description
request object

Methods

getEndPoint()

Description:
  • Returns REST service URL
Source:
Returns:
the URL

getMethod() → {string}

Description:
  • Returns the name of the REST service method
Source:
Returns:
method name
Type
string

getRequest() → {object}

Description:
  • Retrieves the request object.
Source:
Returns:
The request object.
Type
object

getRequestPayload()

Description:
  • Returns the request payload
Source:
Returns:
the payload

getResponse() → {object}

Description:
  • Retrieves the response object.
Source:
Returns:
The response object.
Type
object

getResponsePayload()

Description:
  • Returns the response payload
Source:
Returns:
the payload

logger() → {object}

Description:
  • Retrieves the logger object.
Source:
Returns:
The logger object.
Type
object

setRequestPayload()

Description:
  • Set the request payload
Source:

setResponsePayload()

Description:
  • Set the response payload
Source: