AxBaseAI
Class: AxBaseAI<TChatRequest, TEmbedRequest, TChatResponse, TChatResponseDelta, TEmbedResponse>
Extended by
Type Parameters
• TChatRequest
• TEmbedRequest
• TChatResponse
• TChatResponseDelta
• TEmbedResponse
Implements
Constructors
new AxBaseAI()
new AxBaseAI<
TChatRequest
,TEmbedRequest
,TChatResponse
,TChatResponseDelta
,TEmbedResponse
>(__namedParameters
):AxBaseAI
<TChatRequest
,TEmbedRequest
,TChatResponse
,TChatResponseDelta
,TEmbedResponse
>
Parameters
• __namedParameters: Readonly
<AxBaseAIArgs
>
Returns
AxBaseAI
<TChatRequest
, TEmbedRequest
, TChatResponse
, TChatResponseDelta
, TEmbedResponse
>
Defined in
Properties
apiURL
protected
apiURL:string
Defined in
generateChatReq()?
optional
generateChatReq: (req
,config
) => [API
,TChatRequest
]
Parameters
• req: Readonly
<AxInternalChatRequest
>
• config: Readonly
<AxAIPromptConfig
>
Returns
[API
, TChatRequest
]
Defined in
generateChatResp()?
optional
generateChatResp: (resp
) =>AxChatResponse
Parameters
• resp: Readonly
<TChatResponse
>
Returns
Defined in
generateChatStreamResp()?
optional
generateChatStreamResp: (resp
,state
) =>AxChatResponse
Parameters
• resp: Readonly
<TChatResponseDelta
>
• state: object
Returns
Defined in
generateEmbedReq()?
optional
generateEmbedReq: (req
) => [API
,TEmbedRequest
]
Parameters
• req: Readonly
<AxInternalEmbedRequest
>
Returns
[API
, TEmbedRequest
]
Defined in
generateEmbedResp()?
optional
generateEmbedResp: (resp
) =>AxEmbedResponse
Parameters
• resp: Readonly
<TEmbedResponse
>
Returns
Defined in
headers
protected
headers:Record
<string
,string
>
Defined in
name
protected
name:string
Defined in
supportFor
protected
supportFor:AxBaseAIFeatures
Defined in
Methods
_chat()
_chat(
model
,chatReq
,options
?,span
?):Promise
<AxChatResponse
|ReadableStream
<AxChatResponse
>>
Parameters
• model: string
• chatReq: Readonly
<AxChatRequest
>
• options?: Readonly
<AxAIPromptConfig
& AxAIServiceActionOptions
>
• span?: AxSpan
Returns
Promise
<AxChatResponse
| ReadableStream
<AxChatResponse
>>
Defined in
_embed()
_embed(
embedModel
,embedReq
,options
?,span
?):Promise
<AxEmbedResponse
>
Parameters
• embedModel: string
• embedReq: Readonly
<AxEmbedRequest
>
• options?: Readonly
<AxAIServiceActionOptions
>
• span?: AxSpan
Returns
Promise
<AxEmbedResponse
>
Defined in
chat()
chat(
req
,options
?):Promise
<AxChatResponse
|ReadableStream
<AxChatResponse
>>
Parameters
• req: Readonly
<AxChatRequest
>
• options?: Readonly
<AxAIPromptConfig
& AxAIServiceActionOptions
>
Returns
Promise
<AxChatResponse
| ReadableStream
<AxChatResponse
>>
Implementation of
Defined in
embed()
embed(
req
,options
?):Promise
<AxEmbedResponse
>
Parameters
• req: Readonly
<AxEmbedRequest
>
• options?: Readonly
<AxAIServiceActionOptions
>
Returns
Promise
<AxEmbedResponse
>
Implementation of
Defined in
getEmbedModelInfo()
getEmbedModelInfo():
undefined
|AxModelInfoWithProvider
Returns
undefined
| AxModelInfoWithProvider
Implementation of
Defined in
getFeatures()
getFeatures():
AxBaseAIFeatures
Returns
Implementation of
Defined in
getModelConfig()
getModelConfig():
AxModelConfig
Returns
Implementation of
Defined in
getModelInfo()
getModelInfo():
Readonly
<AxModelInfoWithProvider
>
Returns
Readonly
<AxModelInfoWithProvider
>
Implementation of
Defined in
getModelMap()
getModelMap():
undefined
|AxAIModelMap
Returns
undefined
| AxAIModelMap
Implementation of
Defined in
getName()
getName():
string
Returns
string
Implementation of
Defined in
setAPIURL()
setAPIURL(
apiURL
):void
Parameters
• apiURL: string
Returns
void
Defined in
setHeaders()
setHeaders(
headers
):void
Parameters
• headers: Record
<string
, string
>
Returns
void
Defined in
setName()
setName(
name
):void
Parameters
• name: string
Returns
void
Defined in
setOptions()
setOptions(
options
):void
Parameters
• options: Readonly
<AxAIServiceOptions
>
Returns
void