trinity.explorer.proxy.recorder module#
- class trinity.explorer.proxy.recorder.HistoryRecorder(db_url: str, table_name: str)[源代码]#
基类:
objectRecord chat history into the database.
- record_history(experiences: List[Experience]) None[源代码]#
Save experience to the database.
- update_reward(reward: float, msg_ids: list, run_id: int, task_id: str) List[Experience][源代码]#
Update reward for given response IDs and return the updated experiences.
- 参数:
reward (float) -- The reward value to be updated.
msg_ids (list) -- List of message IDs to update.
run_id (int) -- The run ID associated with the experiences.
task_id (str) -- The task ID associated with the experiences.
- 返回:
List of updated experiences.
- 返回类型:
List[Experience]
备注
Only experiences that have not been consumed (consumed == 0) will be returned. For example, if you call this method multiple times with the same msg_ids, only the first call will return the updated experiences; subsequent calls will return an empty list.