Fix forward reference
This commit is contained in:
committed by
Mattie Ruth
parent
49fba5209c
commit
da0975a4e0
@@ -12,7 +12,6 @@ server messages instead.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
from typing import (
|
from typing import (
|
||||||
TYPE_CHECKING,
|
|
||||||
Any,
|
Any,
|
||||||
Awaitable,
|
Awaitable,
|
||||||
Callable,
|
Callable,
|
||||||
@@ -27,9 +26,6 @@ from pydantic import BaseModel, Field, PrivateAttr
|
|||||||
|
|
||||||
import pipecat.processors.frameworks.rtvi.models_v1 as RTVI
|
import pipecat.processors.frameworks.rtvi.models_v1 as RTVI
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
|
||||||
from pipecat.processors.frameworks.rtvi.processor import RTVIProcessor
|
|
||||||
|
|
||||||
ActionResult = Union[bool, int, float, str, list, dict]
|
ActionResult = Union[bool, int, float, str, list, dict]
|
||||||
|
|
||||||
|
|
||||||
@@ -46,9 +42,7 @@ class RTVIServiceOption(BaseModel):
|
|||||||
|
|
||||||
name: str
|
name: str
|
||||||
type: Literal["bool", "number", "string", "array", "object"]
|
type: Literal["bool", "number", "string", "array", "object"]
|
||||||
handler: Callable[["RTVIProcessor", str, "RTVIServiceOptionConfig"], Awaitable[None]] = Field(
|
handler: Callable[..., Awaitable[None]] = Field(exclude=True)
|
||||||
exclude=True
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class RTVIService(BaseModel):
|
class RTVIService(BaseModel):
|
||||||
@@ -117,9 +111,7 @@ class RTVIAction(BaseModel):
|
|||||||
action: str
|
action: str
|
||||||
arguments: List[RTVIActionArgument] = Field(default_factory=list)
|
arguments: List[RTVIActionArgument] = Field(default_factory=list)
|
||||||
result: Literal["bool", "number", "string", "array", "object"]
|
result: Literal["bool", "number", "string", "array", "object"]
|
||||||
handler: Callable[["RTVIProcessor", str, Dict[str, Any]], Awaitable[ActionResult]] = Field(
|
handler: Callable[..., Awaitable[ActionResult]] = Field(exclude=True)
|
||||||
exclude=True
|
|
||||||
)
|
|
||||||
_arguments_dict: Dict[str, RTVIActionArgument] = PrivateAttr(default={})
|
_arguments_dict: Dict[str, RTVIActionArgument] = PrivateAttr(default={})
|
||||||
|
|
||||||
def model_post_init(self, __context: Any) -> None:
|
def model_post_init(self, __context: Any) -> None:
|
||||||
|
|||||||
Reference in New Issue
Block a user