aisbreaker-core-nodejs - v0.1.15 / services/connectors/OpenaiComImage / OpenaiComImageService
Class: OpenaiComImageService
services/connectors/OpenaiComImage.OpenaiComImageService
Hierarchy
BaseAIsService
<OpenaiComImageProps
,OpenaiComImageDefaults
>↳
OpenaiComImageService
Table of contents
Constructors
Properties
Methods
- checkRequest
- getContext
- getContextService
- getConversationState
- getService
- getServiceUrl
- process
- processUnprotected
Constructors
constructor
• new OpenaiComImageService(props
, serviceDefaults
, auth?
)
Parameters
Name | Type |
---|---|
props | OpenaiComImageProps |
serviceDefaults | OpenaiComImageDefaults |
auth? | Auth |
Overrides
base.BaseAIsService<OpenaiComImageProps, OpenaiComImageDefaults>.constructor
Defined in
aisbreaker-core-nodejs/src/services/connectors/OpenaiComImage.ts:26
Properties
auth
• Optional
auth: Auth
Inherited from
base.BaseAIsService.auth
Defined in
aisbreaker-api-js/build/base/BaseAIsService.d.ts:7
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: OpenaiComImageDefaults
Inherited from
base.BaseAIsService.serviceDefaults
Defined in
aisbreaker-api-js/build/base/BaseAIsService.d.ts:6
serviceProps
• serviceProps: OpenaiComImageProps
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
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
Name | Type | Description |
---|---|---|
request | Request | |
context | string | optional 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
Name | Type |
---|---|
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
Name | Type |
---|---|
request? | Request |
Returns
undefined
| string
Inherited from
base.BaseAIsService.getContextService
Defined in
aisbreaker-api-js/build/base/BaseAIsService.d.ts:43
getConversationState
▸ getConversationState(request
): DefaultConversationState
Parameters
Name | Type |
---|---|
request | Request |
Returns
DefaultConversationState
Inherited from
base.BaseAIsService.getConversationState
Defined in
aisbreaker-api-js/build/base/BaseAIsService.d.ts:63
getService
▸ getService(actualEngine?
): Service
Parameters
Name | Type |
---|---|
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
Name | Type | Description |
---|---|---|
url | undefined | string | The (base) URL specified in AIsServiceProps. |
engine | undefined | string | The engine derived form serviceId |
serviceDefaults | AIsServiceDefaults |
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
Name | Type |
---|---|
request | Request |
Returns
Promise
<ResponseFinal
>
Inherited from
base.BaseAIsService.process
Defined in
aisbreaker-api-js/build/base/BaseAIsService.d.ts:18
processUnprotected
▸ processUnprotected(request
, context
): Promise
<undefined
| ResponseFinal
| AIsError
>
Do the work of process() without the need to care about all error handling.
Parameters
Name | Type | Description |
---|---|---|
request | Request | the request to process |
context | string | optional 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/OpenaiComImage.ts:45