Share via


OpenAIAssistantChannel Class

OpenAI Assistant Channel. Note: This class is experimental and may change in the future. Initialize the OpenAI Assistant Channel.

Constructor

OpenAIAssistantChannel(client: AsyncOpenAI, thread_id: str)

Parameters

Name Description
client
Required
thread_id
Required

Methods

get_history

Get the conversation history.

invoke

Invoke the agent.

invoke_stream

Invoke the agent stream.

receive

Receive the conversation messages.

reset

Reset the agent's thread.

get_history

Get the conversation history.

async get_history() -> AsyncIterable[ChatMessageContent]

invoke

Invoke the agent.

async invoke(agent: Agent) -> AsyncIterable[tuple[bool, ChatMessageContent]]

Parameters

Name Description
agent
Required

The agent to invoke.

invoke_stream

Invoke the agent stream.

async invoke_stream(agent: Agent, messages: list[ChatMessageContent]) -> AsyncIterable[StreamingChatMessageContent]

Parameters

Name Description
agent
Required

The agent to invoke.

messages
Required

The conversation messages.

receive

Receive the conversation messages.

async receive(history: list[ChatMessageContent]) -> None

Parameters

Name Description
history
Required

The conversation messages.

reset

Reset the agent's thread.

async reset() -> None

Attributes

is_experimental

is_experimental = True