Update type annotations in TweaksRequest and Tweaks classes (#1779)

* Update type annotations in TweaksRequest and Tweaks classes

* Merge remote-tracking branch 'origin/dev' into 1776_fix_tweaks
This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-04-26 10:47:30 -03:00 committed by GitHub
commit 45552803d1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 4 deletions

View file

@ -26,7 +26,7 @@ class BuildStatus(Enum):
class TweaksRequest(BaseModel):
tweaks: Optional[Dict[str, Dict[str, str]]] = Field(default_factory=dict)
tweaks: Optional[Dict[str, Dict[str, Any]]] = Field(default_factory=dict)
class UpdateTemplateRequest(BaseModel):

View file

@ -1,7 +1,8 @@
from typing import List, Optional, Union
from typing import Any, List, Optional, Union
from pydantic import BaseModel, Field, RootModel
from langflow.schema.schema import InputType
from pydantic import BaseModel, Field, RootModel
class InputValue(BaseModel):
@ -14,7 +15,7 @@ class InputValue(BaseModel):
class Tweaks(RootModel):
root: dict[str, Union[str, dict[str, str]]] = Field(
root: dict[str, Union[str, dict[str, Any]]] = Field(
description="A dictionary of tweaks to adjust the flow's execution. Allows customizing flow behavior dynamically. All tweaks are overridden by the input values.",
)
model_config = {