data_juicer_agents.tui.models module#

State models for the dj-agents terminal transcript UI.

class data_juicer_agents.tui.models.ChatMessage(role: 'str', text: 'str', markdown: 'bool' = False, timestamp: 'datetime' = <factory>)[源代码]#

基类:object

role: str#
text: str#
markdown: bool = False#
timestamp: datetime#
__init__(role: str, text: str, markdown: bool = False, timestamp: datetime = <factory>) None#
class data_juicer_agents.tui.models.ToolCallState(call_id: 'str', tool: 'str', status: 'str', started_at: 'Optional[datetime]' = None, ended_at: 'Optional[datetime]' = None, elapsed_sec: 'Optional[float]' = None, args_preview: 'str' = '', summary: 'str' = '', error_type: 'Optional[str]' = None, failure_preview: 'str' = '', result_preview: 'str' = '')[源代码]#

基类:object

call_id: str#
tool: str#
status: str#
started_at: datetime | None = None#
ended_at: datetime | None = None#
elapsed_sec: float | None = None#
args_preview: str = ''#
summary: str = ''#
error_type: str | None = None#
failure_preview: str = ''#
result_preview: str = ''#
__init__(call_id: str, tool: str, status: str, started_at: datetime | None = None, ended_at: datetime | None = None, elapsed_sec: float | None = None, args_preview: str = '', summary: str = '', error_type: str | None = None, failure_preview: str = '', result_preview: str = '') None#
class data_juicer_agents.tui.models.TimelineItem(kind: 'str', title: 'str', text: 'str' = '', markdown: 'bool' = False, status: 'Optional[str]' = None, tool: 'Optional[str]' = None, timestamp: 'datetime' = <factory>)[源代码]#

基类:object

kind: str#
title: str#
text: str = ''#
markdown: bool = False#
status: str | None = None#
tool: str | None = None#
timestamp: datetime#
__init__(kind: str, title: str, text: str = '', markdown: bool = False, status: str | None = None, tool: str | None = None, timestamp: datetime = <factory>) None#
class data_juicer_agents.tui.models.TuiState(messages: 'List[ChatMessage]' = <factory>, tool_calls: 'Dict[str, ToolCallState]'=<factory>, tool_call_order: 'List[str]' = <factory>, reasoning_notes: 'List[str]' = <factory>, timeline: 'List[TimelineItem]' = <factory>, status_line: 'str' = 'Ready.', model_label: 'str' = 'session-agent', planner_model_label: 'str' = 'planner', llm_base_url: 'str' = '', permissions_label: 'str' = 'Workspace', cwd: 'str' = '~', session_workdir: 'str' = './.djx')[源代码]#

基类:object

messages: List[ChatMessage]#
tool_calls: Dict[str, ToolCallState]#
tool_call_order: List[str]#
reasoning_notes: List[str]#
timeline: List[TimelineItem]#
status_line: str = 'Ready.'#
model_label: str = 'session-agent'#
planner_model_label: str = 'planner'#
llm_base_url: str = ''#
permissions_label: str = 'Workspace'#
cwd: str = '~'#
session_workdir: str = './.djx'#
add_timeline(*, kind: str, title: str, text: str = '', markdown: bool = False, status: str | None = None, tool: str | None = None, timestamp: datetime | None = None, limit: int = 300) None[源代码]#
add_message(role: str, text: str, markdown: bool = False) None[源代码]#
upsert_tool_call(call_state: ToolCallState) None[源代码]#
recent_messages(limit: int = 12) List[ChatMessage][源代码]#
recent_tool_calls(limit: int = 12) List[ToolCallState][源代码]#
recent_timeline(limit: int = 40) List[TimelineItem][源代码]#
append_reasoning(note: str, *, limit: int = 20) None[源代码]#
__init__(messages: List[ChatMessage] = <factory>, tool_calls: Dict[str, ~data_juicer_agents.tui.models.ToolCallState]=<factory>, tool_call_order: List[str] = <factory>, reasoning_notes: List[str] = <factory>, timeline: List[TimelineItem] = <factory>, status_line: str = 'Ready.', model_label: str = 'session-agent', planner_model_label: str = 'planner', llm_base_url: str = '', permissions_label: str = 'Workspace', cwd: str = '~', session_workdir: str = './.djx') None#