Skip to content

aisbreaker-core-nodejs - v0.1.15 / services/connectors/HuggingfaceCoChat / HuggingfaceCoChatService

Class: HuggingfaceCoChatService

services/connectors/HuggingfaceCoChat.HuggingfaceCoChatService

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new HuggingfaceCoChatService(props, serviceDefaults, auth?)

Parameters

NameType
propsHuggingfaceCoChatProps
serviceDefaultsHuggingfaceCoChatDefaults
auth?Auth

Overrides

base.BaseAIsService<HuggingfaceCoChatProps, HuggingfaceCoChatDefaults&gt;.constructor

Defined in

aisbreaker-core-nodejs/src/services/connectors/HuggingfaceCoChat.ts:49

Properties

auth

Optional auth: Auth

Inherited from

base.BaseAIsService.auth

Defined in

aisbreaker-api-js/build/base/BaseAIsService.d.ts:7


enableDebug

enableDebug: boolean = false

Defined in

aisbreaker-core-nodejs/src/services/connectors/HuggingfaceCoChat.ts:46


enableTraceHttp

enableTraceHttp: boolean = false

Defined in

aisbreaker-core-nodejs/src/services/connectors/HuggingfaceCoChat.ts:47


engine

engine: string

Inherited from

base.BaseAIsService.engine

Defined in

aisbreaker-api-js/build/base/BaseAIsService.d.ts:11


engineOpt

Optional engineOpt: string

Inherited from

base.BaseAIsService.engineOpt

Defined in

aisbreaker-api-js/build/base/BaseAIsService.d.ts:10


serviceDefaults

serviceDefaults: HuggingfaceCoChatDefaults

Inherited from

base.BaseAIsService.serviceDefaults

Defined in

aisbreaker-api-js/build/base/BaseAIsService.d.ts:6


serviceProps

serviceProps: HuggingfaceCoChatProps

Inherited from

base.BaseAIsService.serviceProps

Defined in

aisbreaker-api-js/build/base/BaseAIsService.d.ts:5


task

task: string

Inherited from

base.BaseAIsService.task

Defined in

aisbreaker-api-js/build/base/BaseAIsService.d.ts:8


timeoutMillis

timeoutMillis: number

Defined in

aisbreaker-core-nodejs/src/services/connectors/HuggingfaceCoChat.ts:45


url

url: string

Inherited from

base.BaseAIsService.url

Defined in

aisbreaker-api-js/build/base/BaseAIsService.d.ts:13


urlOpt

Optional urlOpt: string

Inherited from

base.BaseAIsService.urlOpt

Defined in

aisbreaker-api-js/build/base/BaseAIsService.d.ts:12


vendor

vendor: string

Inherited from

base.BaseAIsService.vendor

Defined in

aisbreaker-api-js/build/base/BaseAIsService.d.ts:9

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

base.BaseAIsService.checkRequest

Defined in

aisbreaker-api-js/build/base/BaseAIsService.d.ts:62


getContext

getContext(request?): string

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

Parameters

NameType
request?Request

Returns

string

Inherited from

base.BaseAIsService.getContext

Defined in

aisbreaker-api-js/build/base/BaseAIsService.d.ts:38


getContextService

getContextService(request?): undefined | string

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

Parameters

NameType
request?Request

Returns

undefined | string

Overrides

base.BaseAIsService.getContextService

Defined in

aisbreaker-core-nodejs/src/services/connectors/HuggingfaceCoChat.ts:204


getConversationState

getConversationState(request): DefaultConversationState

Parameters

NameType
requestRequest

Returns

DefaultConversationState

Inherited from

base.BaseAIsService.getConversationState

Defined in

aisbreaker-api-js/build/base/BaseAIsService.d.ts:63


getService

getService(actualEngine?): Service

Parameters

NameType
actualEngine?string

Returns

Service

ResponseFinal.usage.service

Inherited from

base.BaseAIsService.getService

Defined in

aisbreaker-api-js/build/base/BaseAIsService.d.ts:33


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

base.BaseAIsService.getServiceUrl

Defined in

aisbreaker-api-js/build/base/BaseAIsService.d.ts:54


process

process(request): Promise<ResponseFinal>

Let the service do its work.

Parameters

NameType
requestRequest

Returns

Promise<ResponseFinal>

Inherited from

base.BaseAIsService.process

Defined in

aisbreaker-api-js/build/base/BaseAIsService.d.ts:18


processNonStreamingRequest

processNonStreamingRequest(url, request, huggingfaceChatRequest, abortController, responseCollector, conversationState, context): Promise<ResponseFinal | AIsError>

process non-streaming

Parameters

NameType
urlstring
requestRequest
huggingfaceChatRequestHuggingfaceChatRequest
abortControllerAbortController
responseCollectorResponseCollector
conversationStateDefaultConversationState
contextstring

Returns

Promise<ResponseFinal | AIsError>

Defined in

aisbreaker-core-nodejs/src/services/connectors/HuggingfaceCoChat.ts:145


processUnprotected

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

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 | ResponseFinal | AIsError>

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

Overrides

base.BaseAIsService.processUnprotected

Defined in

aisbreaker-core-nodejs/src/services/connectors/HuggingfaceCoChat.ts:71

Released under the MIT License.