trinity.explorer.proxy.recorder module#
- class trinity.explorer.proxy.recorder.HistoryRecorder(db_url: str, table_name: str)[source]#
Bases:
objectRecord chat history into the database using async SQL.
- async record_history(experiences: List[Experience]) None[source]#
Save experiences to the database.
- async update_reward(reward: float, msg_ids: list, run_id: int, task_id: str) List[Experience][source]#
Update reward for given response IDs and return the updated experiences.
Only experiences that have not been consumed (consumed == 0) will be returned.
- class trinity.explorer.proxy.recorder.MemoryHistoryRecorder[source]#
Bases:
objectIn-memory version of HistoryRecorder for high-performance reward update and history recording. All data is stored in memory, and can be flushed to persistent storage as needed.
- async record_history(experiences: List[Experience]) None[source]#
Save experiences in memory.
- async update_reward(reward: float, msg_ids: list, run_id: int, task_id: str) List[Experience][source]#
Update reward for given response IDs and return the updated experiences.