Skip to main content

RuntimeContext

Stentor API Reference


Stentor API Reference / stentor-models/src / RuntimeContext

Interface: RuntimeContext

Defined in: packages/stentor-models/src/Runtime/RuntimeContext.ts:5

Properties​

ovai?​

optional ovai: StudioContext

Defined in: packages/stentor-models/src/Runtime/RuntimeContext.ts:11

Context specific to One Voice AI

Deprecated​

Deprecated in favor of studio key.


studio?​

optional studio: StudioContext

Defined in: packages/stentor-models/src/Runtime/RuntimeContext.ts:15

Context specific to the setup within OC Studio


appData?​

optional appData: AppRuntimeData

Defined in: packages/stentor-models/src/Runtime/RuntimeContext.ts:19

App data used at runtime.


headers?​

optional headers: any

Defined in: packages/stentor-models/src/Runtime/RuntimeContext.ts:23

The headers for the request


environment?​

optional environment: string

Defined in: packages/stentor-models/src/Runtime/RuntimeContext.ts:33

Current environment


rawBody?​

optional rawBody: string

Defined in: packages/stentor-models/src/Runtime/RuntimeContext.ts:41

The request body as a string.

This is extremely important when verifying the payload comes from Alexa. It must be exactly how it comes in. It cannot be JSON.parsed then JSON.stringified as the order is important for certification.

Methods​

getRemainingTimeInMillis()?​

optional getRemainingTimeInMillis(): number

Defined in: packages/stentor-models/src/Runtime/RuntimeContext.ts:29

Optional, for functions as a service, it gets the remaining execution time.

Returns​

number

The remaining execution time of the function


buildResponse()?​

optional buildResponse(code, result): object

Defined in: packages/stentor-models/src/Runtime/RuntimeContext.ts:48

Builds the response for the specific platform

Parameters​

code​

number

result​

object

Returns​

object