ChatAdapter#

class langchain_ai21.chat.chat_adapter.ChatAdapter[source]#

Common interface for the different Chat models available in AI21.

It converts LangChain messages to AI21 messages. Calls the appropriate AI21 model API with the converted messages.

Methods

__init__()#
abstract call(client: Any, stream: Literal[True], **params: Any) Iterator[ChatGenerationChunk][source]#
abstract call(client: Any, stream: Literal[False], **params: Any) List[BaseMessage]
abstract convert_messages(messages: List[BaseMessage]) Dict[str, Any][source]#
Parameters:

messages (List[BaseMessage]) –

Return type:

Dict[str, Any]