Skip to content

aisbreaker-api-js - v0.1.15 / services/connectors/AIsNetworkClient / AIsNetworkClientService

Class: AIsNetworkClientService

services/connectors/AIsNetworkClient.AIsNetworkClientService

Every service API must implement this interface.

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new AIsNetworkClientService(serviceProps, serviceDefaults, auth?)

Parameters

NameType
servicePropsAIsNetworkClientProps
serviceDefaultsAIsNetworkClientDefaults
auth?Auth

Overrides

BaseAIsService.constructor

Defined in

aisbreaker-js/packages/aisbreaker-api-js/src/services/connectors/AIsNetworkClient.ts:43

Properties

auth

Optional auth: Auth

Inherited from

BaseAIsService.auth

Defined in

aisbreaker-js/packages/aisbreaker-api-js/src/base/BaseAIsService.ts:37


engine

engine: string

Inherited from

BaseAIsService.engine

Defined in

aisbreaker-js/packages/aisbreaker-api-js/src/base/BaseAIsService.ts:43


engineOpt

Optional engineOpt: string

Inherited from

BaseAIsService.engineOpt

Defined in

aisbreaker-js/packages/aisbreaker-api-js/src/base/BaseAIsService.ts:42


serviceDefaults

serviceDefaults: AIsNetworkClientDefaults

Inherited from

BaseAIsService.serviceDefaults

Defined in

aisbreaker-js/packages/aisbreaker-api-js/src/base/BaseAIsService.ts:36


serviceProps

serviceProps: AIsNetworkClientProps

set in constructor

Inherited from

BaseAIsService.serviceProps

Defined in

aisbreaker-js/packages/aisbreaker-api-js/src/base/BaseAIsService.ts:35


task

task: string

Inherited from

BaseAIsService.task

Defined in

aisbreaker-js/packages/aisbreaker-api-js/src/base/BaseAIsService.ts:40


url

url: string

Inherited from

BaseAIsService.url

Defined in

aisbreaker-js/packages/aisbreaker-api-js/src/base/BaseAIsService.ts:45


urlOpt

Optional urlOpt: string

Inherited from

BaseAIsService.urlOpt

Defined in

aisbreaker-js/packages/aisbreaker-api-js/src/base/BaseAIsService.ts:44


vendor

vendor: string

Inherited from

BaseAIsService.vendor

Defined in

aisbreaker-js/packages/aisbreaker-api-js/src/base/BaseAIsService.ts:41

Methods

checkRequest

checkRequest(request, context): void

Check that all required fields are present

Parameters

NameTypeDescription
requestRequest
contextstringoptional context information/description/message prefix for logging and for error messages

Returns

void

Inherited from

BaseAIsService.checkRequest

Defined in

aisbreaker-js/packages/aisbreaker-api-js/src/base/BaseAIsService.ts:264


getContext

getContext(request?): string

Optionally, provide additional context information/description for logging and error messages.

Parameters

NameType
request?Request

Returns

string

Inherited from

BaseAIsService.getContext

Defined in

aisbreaker-js/packages/aisbreaker-api-js/src/base/BaseAIsService.ts:217


getContextService

getContextService(request?): undefined | string

Optionally, provide additional context information/description for logging and error messages.

Parameters

NameType
request?Request

Returns

undefined | string

Overrides

BaseAIsService.getContextService

Defined in

aisbreaker-js/packages/aisbreaker-api-js/src/services/connectors/AIsNetworkClient.ts:181


getConversationState

getConversationState(request): DefaultConversationState

Parameters

NameType
requestRequest

Returns

DefaultConversationState

Inherited from

BaseAIsService.getConversationState

Defined in

aisbreaker-js/packages/aisbreaker-api-js/src/base/BaseAIsService.ts:277


getHttpRequestHeaders

getHttpRequestHeaders(secret): any

Parameters

NameType
secretundefined | string

Returns

any

Defined in

aisbreaker-js/packages/aisbreaker-api-js/src/services/connectors/AIsNetworkClient.ts:187


getService

getService(actualEngine?): Service

Parameters

NameType
actualEngine?string

Returns

Service

ResponseFinal.usage.service

Inherited from

BaseAIsService.getService

Defined in

aisbreaker-js/packages/aisbreaker-api-js/src/base/BaseAIsService.ts:200


getServiceUrl

getServiceUrl(url, engine, serviceDefaults): undefined | string

Derive the service URL.

Implemented as method here to allow overriding.

Parameters

NameTypeDescription
urlundefined | stringThe (base) URL specified in AIsServiceProps.
engineundefined | stringThe engine derived form serviceId
serviceDefaultsAIsServiceDefaults

Returns

undefined | string

The URL to access the actual AI service.

Inherited from

BaseAIsService.getServiceUrl

Defined in

aisbreaker-js/packages/aisbreaker-api-js/src/base/BaseAIsService.ts:249


process

process(request): Promise<ResponseFinal>

Let the service do its work.

Parameters

NameType
requestRequest

Returns

Promise<ResponseFinal>

Inherited from

BaseAIsService.process

Defined in

aisbreaker-js/packages/aisbreaker-api-js/src/base/BaseAIsService.ts:70


processNonStreamingRequest

processNonStreamingRequest(url, request, aisNetworkRequest, abortController, context): Promise<AIsError | ResponseFinal>

process non-streaming

Parameters

NameType
urlstring
requestRequest
aisNetworkRequestAIsNetworkRequest
abortControllerAbortController
contextstring

Returns

Promise<AIsError | ResponseFinal>

Defined in

aisbreaker-js/packages/aisbreaker-api-js/src/services/connectors/AIsNetworkClient.ts:79


processStreamingRequest

processStreamingRequest(url, request, aisNetworkRequest, abortController, context): Promise<undefined | AIsError | ResponseFinal>

process streaming

Parameters

NameType
urlstring
requestRequest
aisNetworkRequestAIsNetworkRequest
abortControllerAbortController
contextstring

Returns

Promise<undefined | AIsError | ResponseFinal>

Defined in

aisbreaker-js/packages/aisbreaker-api-js/src/services/connectors/AIsNetworkClient.ts:102


processUnprotected

processUnprotected(request, context): Promise<undefined | AIsError | ResponseFinal>

Do the work of process() without the need to care about all error handling.

Parameters

NameTypeDescription
requestRequestthe request to process
contextstringoptional context information/description/message prefix for logging and for error messages

Returns

Promise<undefined | AIsError | ResponseFinal>

The final result. In the case of an error it returns an AIsError OR throws an AIError or general Error.

Overrides

BaseAIsService.processUnprotected

Defined in

aisbreaker-js/packages/aisbreaker-api-js/src/services/connectors/AIsNetworkClient.ts:57

Released under the MIT License.