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

Method operation

trinity/buffer/storage/sql.py:72–89  ·  view source on GitHub ↗
(session: AsyncSession)

Source from the content-addressed store, hash-verified

70 await self.prepare()
71
72 async def operation(session: AsyncSession):
73 for exp in data:
74 exp_bytes = exp.serialize()
75 if (
76 self.max_experience_bytes > 0
77 and exp_bytes is not None
78 and len(exp_bytes) > self.max_experience_bytes
79 ):
80 self.logger.warning(
81 f"Experience size {len(exp_bytes)} bytes exceeds "
82 f"max_experience_bytes {self.max_experience_bytes}, skipping."
83 )
84 continue
85 meta_row = self.table_model_cls.from_experience(exp)
86 session.add(meta_row)
87 await session.flush()
88 blob_row = self.blob_model_cls(id=meta_row.id, experience_bytes=exp_bytes)
89 session.add(blob_row)
90
91 await async_run_with_retry_session(
92 self.session, operation, self.max_retry_times, self.max_retry_interval

Callers

nothing calls this directly

Calls 6

_fetch_blobsMethod · 0.95
_assemble_experiencesMethod · 0.95
serializeMethod · 0.80
from_experienceMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected