File tree Expand file tree Collapse file tree 4 files changed +29
-5
lines changed
rpc/generated/test_service
stream/generated/test_service Expand file tree Collapse file tree 4 files changed +29
-5
lines changed Original file line number Diff line number Diff line change 66from pydantic import TypeAdapter
77
88from replit_river .error_schema import RiverError
9+
10+ RiverErrorTypeAdapter = TypeAdapter (RiverError )
911import replit_river as river
1012
1113
12- from .rpc_method import Rpc_MethodInput , Rpc_MethodOutput , encode_Rpc_MethodInput
14+ from .rpc_method import (
15+ Rpc_MethodInput ,
16+ Rpc_MethodInputTypeAdapter ,
17+ Rpc_MethodOutput ,
18+ Rpc_MethodOutputTypeAdapter ,
19+ encode_Rpc_MethodInput ,
20+ )
1321
1422
1523class Test_ServiceService :
@@ -26,10 +34,10 @@ async def rpc_method(
2634 "rpc_method" ,
2735 input ,
2836 encode_Rpc_MethodInput ,
29- lambda x : TypeAdapter ( Rpc_MethodOutput ) .validate_python (
37+ lambda x : Rpc_MethodOutputTypeAdapter .validate_python (
3038 x # type: ignore[arg-type]
3139 ),
32- lambda x : TypeAdapter ( RiverError ) .validate_python (
40+ lambda x : RiverErrorTypeAdapter .validate_python (
3341 x # type: ignore[arg-type]
3442 ),
3543 timeout ,
Original file line number Diff line number Diff line change @@ -39,5 +39,11 @@ class Rpc_MethodInput(TypedDict):
3939 data : str
4040
4141
42+ Rpc_MethodInputTypeAdapter = TypeAdapter (Rpc_MethodInput ) # type: ignore
43+
44+
4245class Rpc_MethodOutput (BaseModel ):
4346 data : str
47+
48+
49+ Rpc_MethodOutputTypeAdapter = TypeAdapter (Rpc_MethodOutput ) # type: ignore
Original file line number Diff line number Diff line change 66from pydantic import TypeAdapter
77
88from replit_river .error_schema import RiverError
9+
10+ RiverErrorTypeAdapter = TypeAdapter (RiverError )
911import replit_river as river
1012
1113
1214from .stream_method import (
1315 Stream_MethodInput ,
16+ Stream_MethodInputTypeAdapter ,
1417 Stream_MethodOutput ,
18+ Stream_MethodOutputTypeAdapter ,
1519 encode_Stream_MethodInput ,
1620)
1721
@@ -31,10 +35,10 @@ async def stream_method(
3135 inputStream ,
3236 None ,
3337 encode_Stream_MethodInput ,
34- lambda x : TypeAdapter ( Stream_MethodOutput ) .validate_python (
38+ lambda x : Stream_MethodOutputTypeAdapter .validate_python (
3539 x # type: ignore[arg-type]
3640 ),
37- lambda x : TypeAdapter ( RiverError ) .validate_python (
41+ lambda x : RiverErrorTypeAdapter .validate_python (
3842 x # type: ignore[arg-type]
3943 ),
4044 )
Original file line number Diff line number Diff line change @@ -39,5 +39,11 @@ class Stream_MethodInput(TypedDict):
3939 data : str
4040
4141
42+ Stream_MethodInputTypeAdapter = TypeAdapter (Stream_MethodInput ) # type: ignore
43+
44+
4245class Stream_MethodOutput (BaseModel ):
4346 data : str
47+
48+
49+ Stream_MethodOutputTypeAdapter = TypeAdapter (Stream_MethodOutput ) # type: ignore
You can’t perform that action at this time.
0 commit comments