MCPcopy Create free account
hub / github.com/agentscope-ai/Trinity-RFT / prepare

Method prepare

trinity/buffer/storage/sql.py:57–67  ·  view source on GitHub ↗

Initialize async engine and create tables.

(self)

Source from the content-addressed store, hash-verified

55 self._read_method = self._read_fifo
56
57 async def prepare(self) -> None:
58 """Initialize async engine and create tables."""
59 if self._initialized:
60 return
61 result = await init_async_engine(
62 self.config.path, self.config.name, self.config.schema_type # type: ignore
63 )
64 self.engine, self.table_model_cls, self.blob_model_cls = result
65 self.session = async_sessionmaker(self.engine, expire_on_commit=False)
66 self._initialized = True
67 self.logger.info(f"SQL storage initialized at {self.config.path}")
68
69 async def write(self, data: List[Experience]) -> None:
70 await self.prepare()

Callers 12

writeMethod · 0.95
readMethod · 0.95
countMethod · 0.95
queryMethod · 0.95
test_read_timeoutMethod · 0.95

Calls 1

init_async_engineFunction · 0.90