A Python client for programmatically interacting with SolveIt dialogs.
Set your SOLVEIT_TOKEN environment variable before using the client.
To find your token:
- Open Chrome DevTools (
F12orCmd+Option+I) - Go to the Application tab
- In the sidebar, expand Cookies and select your SolveIt domain
- Find the cookie named
_solveit - Copy its value—that’s your token
export SOLVEIT_TOKEN='your-token-here'!pip install solveit_clientfrom solveit_client.core import *
# Initialize client (uses SOLVEIT_TOKEN env var by default)
sic = SolveItClient('https://your-instance.solve.it.com/'); sicSolveItClient(self.url='https://your-instance.solve.it.com/')
Use the /test_route to confirm your client has connect:
sic('/test_route')'here'
If you get an error saying No access. Please login and then retry.,
double check your SOLVEIT_TOKEN is correct and exported.
# Create a dialog
dlg = sic.create_dialog('my-project/experiment'); dlgDialog: my-project/experiment | Mode: learning
# Add and execute code
msg = dlg.add_msg('1 + 1'); msgMessage: _59a51ada | Type: code | 1 + 1 | Output:
msg.exec(); msgMessage: _59a51ada | Type: code | 1 + 1 | Output: 2
# Add a prompt for AI assistance
ai_msg = dlg.add_msg('Tell me about otters 🤓', msg_type='prompt')
ai_msg.exec(); ai_msgMessage: _e8ede692 | Type: prompt | Tell me about otters 🤓 | Output: Otters are fascinating semi-aquatic mammals! They'...
# View all messages
dlg.messagesdlg.delete(){'success': 'deleted "/app/data/my-project/experiment"'}