Skip to content

Commit

Permalink
fix mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoloboschi committed Jul 2, 2024
1 parent fc86f39 commit 5407133
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/backend/base/langflow/base/models/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def get_chat_result(
raise e

@abstractmethod
def build_model(self) -> LanguageModel:
def build_model(self) -> LanguageModel: # type: ignore
"""
Implement this method to build the model.
"""
2 changes: 1 addition & 1 deletion src/backend/base/langflow/components/models/CohereModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class CohereComponent(LCModelComponent):
),
]

def build_model(self) -> LanguageModel | BaseChatModel:
def build_model(self) -> LanguageModel:
cohere_api_key = self.cohere_api_key
temperature = self.temperature

Expand Down
4 changes: 3 additions & 1 deletion src/backend/base/langflow/components/vectorstores/AstraDB.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from typing import Optional

from loguru import logger

from langchain_core.vectorstores import VectorStore
Expand All @@ -23,7 +25,7 @@ class AstraVectorStoreComponent(LCVectorStoreComponent):
documentation: str = "https://python.langchain.com/docs/integrations/vectorstores/astradb"
icon: str = "AstraDB"

_cached_vectorstore: VectorStore = None
_cached_vectorstore: Optional[VectorStore] = None

inputs = [
StrInput(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import List
from typing import List, Optional

from langchain_community.vectorstores import Cassandra

Expand All @@ -24,7 +24,7 @@ class CassandraVectorStoreComponent(LCVectorStoreComponent):
documentation = "https://python.langchain.com/docs/modules/data_connection/vectorstores/integrations/cassandra"
icon = "Cassandra"

_cached_vectorstore: Cassandra = None
_cached_vectorstore: Optional[Cassandra] = None

inputs = [
MessageTextInput(
Expand Down

0 comments on commit 5407133

Please sign in to comment.