mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-21 10:26:57 +00:00
Description: Added support for AI21 new model - Jamba Twitter handle: https://github.com/AI21Labs --------- Co-authored-by: Asaf Gardin <asafg@ai21.com> Co-authored-by: Erick Friis <erick@langchain.dev>
16 lines
351 B
Python
16 lines
351 B
Python
from langchain_ai21.chat.chat_adapter import (
|
|
ChatAdapter,
|
|
J2ChatAdapter,
|
|
JambaChatCompletionsAdapter,
|
|
)
|
|
|
|
|
|
def create_chat_adapter(model: str) -> ChatAdapter:
|
|
if "j2" in model:
|
|
return J2ChatAdapter()
|
|
|
|
if "jamba" in model:
|
|
return JambaChatCompletionsAdapter()
|
|
|
|
raise ValueError(f"Model {model} not supported.")
|