🐛 fix(PromptRunner.py): change beta variable type from bool to str to match the field_config type
🐛 fix(Metaphor.py): change beta variable type from bool to str to match the field_config type 🐛 fix(GetRequest.py): change beta variable type from bool to str to match the field_config type 🐛 fix(JSONDocumentBuilder.py): change beta variable type from bool to str to match the field_config type 🐛 fix(PostRequest.py): change beta variable type from bool to str to match the field_config type 🐛 fix(UpdateRequest.py): change beta variable type from bool to str to match the field_config type 🐛 fix(Chroma.py): change beta variable type from bool to str to match the field_config type 🐛 fix(Vectara.py): change beta variable type from bool to str to match the field_config type 🐛 fix(crud.py): wrap the code in try-except block to handle any exceptions
This commit is contained in:
parent
8c8b863b18
commit
22d2eee2da
10 changed files with 20 additions and 17 deletions
|
|
@ -8,7 +8,7 @@ from langchain.schema import Document
|
|||
class PromptRunner(CustomComponent):
|
||||
display_name: str = "Prompt Runner"
|
||||
description: str = "Run a Chain with the given PromptTemplate"
|
||||
beta = True
|
||||
beta: str = True
|
||||
field_config = {
|
||||
"llm": {"display_name": "LLM"},
|
||||
"prompt": {
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ class MetaphorToolkit(CustomComponent):
|
|||
documentation = (
|
||||
"https://python.langchain.com/docs/integrations/tools/metaphor_search"
|
||||
)
|
||||
beta = True
|
||||
beta: str = True
|
||||
# api key should be password = True
|
||||
field_config = {
|
||||
"metaphor_api_key": {"display_name": "Metaphor API Key", "password": True},
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ class GetRequest(CustomComponent):
|
|||
description: str = "Make a GET request to the given URL."
|
||||
output_types: list[str] = ["Document"]
|
||||
documentation: str = "https://docs.langflow.org/components/utilities#get-request"
|
||||
beta = True
|
||||
beta: str = True
|
||||
field_config = {
|
||||
"url": {
|
||||
"display_name": "URL",
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ class JSONDocumentBuilder(CustomComponent):
|
|||
display_name: str = "JSON Document Builder"
|
||||
description: str = "Build a Document containing a JSON object using a key and another Document page content."
|
||||
output_types: list[str] = ["Document"]
|
||||
beta = True
|
||||
beta: str = True
|
||||
documentation: str = (
|
||||
"https://docs.langflow.org/components/utilities#json-document-builder"
|
||||
)
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ class PostRequest(CustomComponent):
|
|||
description: str = "Make a POST request to the given URL."
|
||||
output_types: list[str] = ["Document"]
|
||||
documentation: str = "https://docs.langflow.org/components/utilities#post-request"
|
||||
beta = True
|
||||
beta: str = True
|
||||
field_config = {
|
||||
"url": {"display_name": "URL", "info": "The URL to make the request to."},
|
||||
"headers": {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ class UpdateRequest(CustomComponent):
|
|||
description: str = "Make a PATCH request to the given URL."
|
||||
output_types: list[str] = ["Document"]
|
||||
documentation: str = "https://docs.langflow.org/components/utilities#update-request"
|
||||
beta = True
|
||||
beta: str = True
|
||||
field_config = {
|
||||
"url": {"display_name": "URL", "info": "The URL to make the request to."},
|
||||
"headers": {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ class ChromaComponent(CustomComponent):
|
|||
display_name: str = "Chroma (Custom Component)"
|
||||
description: str = "Implementation of Vector Store using Chroma"
|
||||
documentation = "https://python.langchain.com/docs/integrations/vectorstores/chroma"
|
||||
beta = True
|
||||
beta: str = True
|
||||
|
||||
def build_config(self):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ class VectaraComponent(CustomComponent):
|
|||
documentation = (
|
||||
"https://python.langchain.com/docs/integrations/vectorstores/vectara"
|
||||
)
|
||||
beta = True
|
||||
beta: str = True
|
||||
# api key should be password = True
|
||||
field_config = {
|
||||
"vectara_customer_id": {"display_name": "Vectara Customer ID"},
|
||||
|
|
|
|||
|
|
@ -54,6 +54,9 @@ def update_user(
|
|||
|
||||
|
||||
def update_user_last_login_at(user_id: UUID, db: Session = Depends(get_session)):
|
||||
user_data = UserUpdate(last_login_at=datetime.now(timezone.utc)) # type: ignore
|
||||
user = get_user_by_id(db, user_id)
|
||||
return update_user(user, user_data, db)
|
||||
try:
|
||||
user_data = UserUpdate(last_login_at=datetime.now(timezone.utc)) # type: ignore
|
||||
user = get_user_by_id(db, user_id)
|
||||
return update_user(user, user_data, db)
|
||||
except Exception:
|
||||
pass
|
||||
|
|
|
|||
|
|
@ -45,9 +45,9 @@ class UserRead(SQLModel):
|
|||
|
||||
|
||||
class UserUpdate(SQLModel):
|
||||
username: Optional[str] = Field()
|
||||
profile_image: Optional[str] = Field()
|
||||
password: Optional[str] = Field()
|
||||
is_active: Optional[bool] = Field()
|
||||
is_superuser: Optional[bool] = Field()
|
||||
last_login_at: Optional[datetime] = Field()
|
||||
username: Optional[str]
|
||||
profile_image: Optional[str]
|
||||
password: Optional[str]
|
||||
is_active: Optional[bool]
|
||||
is_superuser: Optional[bool]
|
||||
last_login_at: Optional[datetime]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue