@@ -1335,23 +1335,23 @@ def __init__(self, user, token=None):
13351335class ToolSource (Base , Dictifiable , RepresentById ):
13361336 __tablename__ = "tool_source"
13371337
1338- id = Column ( Integer , primary_key = True )
1339- hash = Column (Unicode (255 ))
1340- source = Column (JSONType )
1338+ id : Mapped [ int ] = mapped_column ( primary_key = True )
1339+ hash : Mapped [ Optional [ str ]] = mapped_column (Unicode (255 ))
1340+ source : Mapped [ dict ] = mapped_column (JSONType )
13411341
13421342
13431343class ToolRequest (Base , Dictifiable , RepresentById ):
13441344 __tablename__ = "tool_request"
13451345
1346- id = Column ( Integer , primary_key = True )
1347- tool_source_id = Column ( Integer , ForeignKey ("tool_source.id" ), index = True )
1348- history_id = Column ( Integer , ForeignKey ("history.id" ), index = True )
1349- request = Column (JSONType )
1350- state = Column (TrimmedString (32 ), index = True )
1351- state_message = Column (JSONType , index = True )
1346+ id : Mapped [ int ] = mapped_column ( primary_key = True )
1347+ tool_source_id : Mapped [ int ] = mapped_column ( ForeignKey ("tool_source.id" ), index = True )
1348+ history_id : Mapped [ Optional [ int ]] = mapped_column ( ForeignKey ("history.id" ), index = True )
1349+ request : Mapped [ dict ] = mapped_column (JSONType )
1350+ state : Mapped [ Optional [ str ]] = mapped_column (TrimmedString (32 ), index = True )
1351+ state_message : Mapped [ Optional [ str ]] = mapped_column (JSONType , index = True )
13521352
1353- tool_source = relationship ("ToolSource" )
1354- history = relationship ( "History" , back_populates = "tool_requests" )
1353+ tool_source : Mapped [ "ToolSource" ] = relationship ()
1354+ history : Mapped [ Optional [ "History" ]] = relationship ( back_populates = "tool_requests" )
13551355
13561356 class states (str , Enum ):
13571357 NEW = "new"
0 commit comments