Skip to content

The agent engineering platform.

Fix LLM types so that they can be loaded from config dicts (#6235)

Jan Pawellek3e3ed8c5c993
diff --git a/langchain/llms/aleph_alpha.py b/langchain/llms/aleph_alpha.py
index 2090badb83..b006ca95f5 100644
--- a/langchain/llms/aleph_alpha.py
+++ b/langchain/llms/aleph_alpha.py
@@ -23,7 +23,7 @@ class AlephAlpha(LLM):
.. code-block:: python
from langchain.llms import AlephAlpha
- alpeh_alpha = AlephAlpha(aleph_alpha_api_key="my-api-key")
+ aleph_alpha = AlephAlpha(aleph_alpha_api_key="my-api-key")
"""
client: Any #: :meta private:
@@ -199,7 +199,7 @@ class AlephAlpha(LLM):
@property
def _llm_type(self) -> str:
"""Return type of llm."""
- return "alpeh_alpha"
+ return "aleph_alpha"
def _call(
self,
@@ -220,7 +220,7 @@ class AlephAlpha(LLM):
Example:
.. code-block:: python
- response = alpeh_alpha("Tell me a joke.")
+ response = aleph_alpha("Tell me a joke.")
"""
from aleph_alpha_client import CompletionRequest, Prompt
diff --git a/langchain/llms/bananadev.py b/langchain/llms/bananadev.py
index 2fc2f06077..a9c68780e6 100644
--- a/langchain/llms/bananadev.py
+++ b/langchain/llms/bananadev.py
@@ -80,7 +80,7 @@ class Banana(LLM):
@property
def _llm_type(self) -> str:
"""Return type of llm."""
- return "banana"
+ return "bananadev"
def _call(
self,
diff --git a/langchain/llms/huggingface_text_gen_inference.py b/langchain/llms/huggingface_text_gen_inference.py
index cab1178983..56b95636dc 100644
--- a/langchain/llms/huggingface_text_gen_inference.py
+++ b/langchain/llms/huggingface_text_gen_inference.py
@@ -106,7 +106,7 @@ class HuggingFaceTextGenInference(LLM):
@property
def _llm_type(self) -> str:
"""Return type of llm."""
- return "hf_textgen_inference"
+ return "huggingface_textgen_inference"
def _call(
self,
diff --git a/langchain/llms/llamacpp.py b/langchain/llms/llamacpp.py
index a28233b67b..19d9e529f7 100644
--- a/langchain/llms/llamacpp.py
+++ b/langchain/llms/llamacpp.py
@@ -168,7 +168,7 @@ class LlamaCpp(LLM):
@property
def _llm_type(self) -> str:
"""Return type of llm."""
- return "llama.cpp"
+ return "llamacpp"
def _get_parameters(self, stop: Optional[List[str]] = None) -> Dict[str, Any]:
"""
diff --git a/langchain/llms/mosaicml.py b/langchain/llms/mosaicml.py
index 594732c983..e6c570f201 100644
--- a/langchain/llms/mosaicml.py
+++ b/langchain/llms/mosaicml.py
@@ -86,7 +86,7 @@ class MosaicML(LLM):
@property
def _llm_type(self) -> str:
"""Return type of llm."""
- return "mosaicml"
+ return "mosaic"
def _transform_prompt(self, prompt: str) -> str:
"""Transform prompt."""
diff --git a/langchain/llms/rwkv.py b/langchain/llms/rwkv.py
index af8703cb19..b4d38244f7 100644
--- a/langchain/llms/rwkv.py
+++ b/langchain/llms/rwkv.py
@@ -140,7 +140,7 @@ class RWKV(LLM, BaseModel):
@property
def _llm_type(self) -> str:
"""Return the type of llm."""
- return "rwkv-4"
+ return "rwkv"
def run_rnn(self, _tokens: List[str], newline_adj: int = 0) -> Any:
AVOID_REPEAT_TOKENS = []