Skip to content

AxAICohere

Class: AxAICohere

Extends

Constructors

new AxAICohere()

new AxAICohere(__namedParameters): AxAICohere

Parameters

__namedParameters: Readonly<Omit<AxAICohereArgs, "name">>

Returns

AxAICohere

Overrides

AxBaseAI.constructor

Defined in

src/ax/ai/cohere/api.ts:61

Properties

apiURL

protected apiURL: string

Inherited from

AxBaseAI.apiURL

Defined in

src/ax/ai/base.ts:95


headers

protected headers: Record<string, string>

Inherited from

AxBaseAI.headers

Defined in

src/ax/ai/base.ts:97


name

protected name: string

Inherited from

AxBaseAI.name

Defined in

src/ax/ai/base.ts:96


supportFor

protected supportFor: AxBaseAIFeatures

Inherited from

AxBaseAI.supportFor

Defined in

src/ax/ai/base.ts:98

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

Inherited from

AxBaseAI._chat

Defined in

src/ax/ai/base.ts:250


_embed()

_embed(embedModel, embedReq, options?, span?): Promise<AxEmbedResponse>

Parameters

embedModel: string

embedReq: Readonly<AxEmbedRequest>

options?: Readonly<AxAIServiceActionOptions>

span?: AxSpan

Returns

Promise<AxEmbedResponse>

Inherited from

AxBaseAI._embed

Defined in

src/ax/ai/base.ts:397


chat()

chat(req, options?): Promise<AxChatResponse | ReadableStream<AxChatResponse>>

Parameters

req: Readonly<AxChatRequest>

options?: Readonly<AxAIPromptConfig & AxAIServiceActionOptions>

Returns

Promise<AxChatResponse | ReadableStream<AxChatResponse>>

Inherited from

AxBaseAI.chat

Defined in

src/ax/ai/base.ts:208


embed()

embed(req, options?): Promise<AxEmbedResponse>

Parameters

req: Readonly<AxEmbedRequest>

options?: Readonly<AxAIServiceActionOptions>

Returns

Promise<AxEmbedResponse>

Inherited from

AxBaseAI.embed

Defined in

src/ax/ai/base.ts:364


generateChatReq()

generateChatReq(req, _config): [API, AxAICohereChatRequest]

Parameters

req: Readonly<AxInternalChatRequest>

_config: Readonly<AxAIPromptConfig>

Returns

[API, AxAICohereChatRequest]

Overrides

AxBaseAI.generateChatReq

Defined in

src/ax/ai/cohere/api.ts:101


generateChatResp()

generateChatResp(resp): AxChatResponse

Parameters

resp: Readonly<AxAICohereChatResponse>

Returns

AxChatResponse

Overrides

AxBaseAI.generateChatResp

Defined in

src/ax/ai/cohere/api.ts:217


generateChatStreamResp()

generateChatStreamResp(resp, state): AxChatResponse

Parameters

resp: Readonly<AxAICohereChatResponseDelta>

state: object

Returns

AxChatResponse

Overrides

AxBaseAI.generateChatStreamResp

Defined in

src/ax/ai/cohere/api.ts:279


generateEmbedReq()

generateEmbedReq(req): [API, AxAICohereEmbedRequest]

Parameters

req: Readonly<AxInternalEmbedRequest>

Returns

[API, AxAICohereEmbedRequest]

Overrides

AxBaseAI.generateEmbedReq

Defined in

src/ax/ai/cohere/api.ts:190


generateEmbedResp()

generateEmbedResp(resp): AxEmbedResponse

Parameters

resp: Readonly<AxAICohereEmbedResponse>

Returns

AxEmbedResponse

Overrides

AxBaseAI.generateEmbedResp

Defined in

src/ax/ai/cohere/api.ts:301


getEmbedModelInfo()

getEmbedModelInfo(): undefined | AxModelInfoWithProvider

Returns

undefined | AxModelInfoWithProvider

Inherited from

AxBaseAI.getEmbedModelInfo

Defined in

src/ax/ai/base.ts:183


getFeatures()

getFeatures(): AxBaseAIFeatures

Returns

AxBaseAIFeatures

Inherited from

AxBaseAI.getFeatures

Defined in

src/ax/ai/base.ts:200


getModelConfig()

getModelConfig(): AxModelConfig

Returns

AxModelConfig

Overrides

AxBaseAI.getModelConfig

Defined in

src/ax/ai/cohere/api.ts:87


getModelInfo()

getModelInfo(): Readonly<AxModelInfoWithProvider>

Returns

Readonly<AxModelInfoWithProvider>

Inherited from

AxBaseAI.getModelInfo

Defined in

src/ax/ai/base.ts:176


getModelMap()

getModelMap(): undefined | AxAIModelMap

Returns

undefined | AxAIModelMap

Inherited from

AxBaseAI.getModelMap

Defined in

src/ax/ai/base.ts:192


getName()

getName(): string

Returns

string

Inherited from

AxBaseAI.getName

Defined in

src/ax/ai/base.ts:196


setAPIURL()

setAPIURL(apiURL): void

Parameters

apiURL: string

Returns

void

Inherited from

AxBaseAI.setAPIURL

Defined in

src/ax/ai/base.ts:137


setHeaders()

setHeaders(headers): void

Parameters

headers: Record<string, string>

Returns

void

Inherited from

AxBaseAI.setHeaders

Defined in

src/ax/ai/base.ts:141


setName()

setName(name): void

Parameters

name: string

Returns

void

Inherited from

AxBaseAI.setName

Defined in

src/ax/ai/base.ts:133


setOptions()

setOptions(options): void

Parameters

options: Readonly<AxAIServiceOptions>

Returns

void

Inherited from

AxBaseAI.setOptions

Defined in

src/ax/ai/base.ts:145