MCPcopy Create free account
hub / github.com/VectifyAI/OpenKB / new

Method new

openkb/agent/chat_session.py:122–137  ·  view source on GitHub ↗
(cls, kb_dir: Path, model: str, language: str)

Source from the content-addressed store, hash-verified

120
121 @classmethod
122 def new(cls, kb_dir: Path, model: str, language: str) -> "ChatSession":
123 now = _utcnow_iso()
124 sid = _gen_id()
125 return cls(
126 id=sid,
127 created_at=now,
128 updated_at=now,
129 model=model,
130 language=language,
131 title="",
132 turn_count=0,
133 history=[],
134 user_turns=[],
135 assistant_texts=[],
136 path=chats_dir(kb_dir) / f"{sid}.json",
137 )
138
139 def to_dict(self) -> dict[str, Any]:
140 return {

Calls 3

_utcnow_isoFunction · 0.85
_gen_idFunction · 0.85
chats_dirFunction · 0.85