mirror of
https://github.com/hwchase17/langchain
synced 2024-11-10 01:10:59 +00:00
a70b7a688e
Added missed docstrings. Format docstrings to the consistent format (used in the API Reference)
24 lines
516 B
Python
24 lines
516 B
Python
from langchain_ai21.chat.chat_adapter import (
|
|
ChatAdapter,
|
|
J2ChatAdapter,
|
|
JambaChatCompletionsAdapter,
|
|
)
|
|
|
|
|
|
def create_chat_adapter(model: str) -> ChatAdapter:
|
|
"""Create a chat adapter based on the model.
|
|
|
|
Args:
|
|
model: The model to create the chat adapter for.
|
|
|
|
Returns:
|
|
The chat adapter.
|
|
"""
|
|
if "j2" in model:
|
|
return J2ChatAdapter()
|
|
|
|
if "jamba" in model:
|
|
return JambaChatCompletionsAdapter()
|
|
|
|
raise ValueError(f"Model {model} not supported.")
|