🔄 Big News! bazed.ai is now sagentic.ai. Same vision, new name!

Skip to content

@sagentic-ai/sagentic-af / ClientMux

ClientMux ​

ClientMux is a multiplexer for clients of multiple OpenAI models.

Param ​

OpenAI API Key

Param ​

ClientOptions

Constructors ​

new ClientMux(openAIKey, options) ​

ts
new ClientMux(openAIKey, options?): ClientMux

Parameters ​

• openAIKey: string

• options?: ClientMuxOptions

Returns ​

ClientMux

Source ​

src/client.ts:430

Properties ​

clients ​

ts
private clients: Record<ModelType, Client>;

Source ​

src/client.ts:428

Methods ​

createChatCompletion() ​

ts
createChatCompletion(request): Promise<ChatCompletion>

Parameters ​

• request: ChatCompletionCreateParamsNonStreaming

Returns ​

Promise<ChatCompletion>

Source ​

src/client.ts:453


start() ​

ts
start(): void

Returns ​

void

Source ​

src/client.ts:441


stop() ​

ts
stop(): void

Returns ​

void

Source ​

src/client.ts:447