INNER CODE UNIT · Python
__init__
tomtommyyuan/spmind · gradio_app.py:13
def __init__(self):
self.agent: SPMindAgent | None = None
self.model = os.getenv("SPMIND_MODEL", "claude-sonnet-4-5")
self._init_agent()
def _init_agent(self):
"""Initialize the SP-Mind agent."""
try:
self.agent = SPMindAgent(
path="./data",
model=self.model,
permission_mode="bypassPermissions",
)
except Exception as e:
print(f"Agent initialization failed: {e}")
self.agent = None
def reset_conversation(self):