Endpoints
| Method | Path | Description |
|---|---|---|
POST | /api/v1/guide/create_session | Create a new guided learning session |
POST | /api/v1/guide/start | Start a session (get the first knowledge point) |
POST | /api/v1/guide/next | Advance to the next knowledge point |
POST | /api/v1/guide/chat | Send a chat message within a session |
POST | /api/v1/guide/fix_html | Fix a bug in the generated HTML exercise |
GET | /api/v1/guide/session/{session_id} | Get session state |
GET | /api/v1/guide/session/{session_id}/html | Get the current HTML exercise |
WS | /api/v1/guide/ws/{session_id} | Real-time interaction via WebSocket |
GET | /api/v1/guide/health | Health check |
POST /api/v1/guide/create_session
Create a new guided learning session. You can provide either a single notebook ID or a list of records from multiple notebooks.
Request body
ID of a single notebook whose records will be used. Provide either this or
records.List of record objects for cross-notebook mode. Provide either this or
notebook_id.Response
Identifier for the new session. Required for all subsequent requests.
Ordered list of knowledge points extracted from the notebook records.
Total number of knowledge points in the session.
POST /api/v1/guide/start
Start a session and retrieve the first knowledge point with its explanation and interactive exercise.
Request body
Session identifier.
POST /api/v1/guide/next
Advance to the next knowledge point in the session.
Request body
Session identifier.
true when all knowledge points have been covered.POST /api/v1/guide/chat
Send a question or message within an active session. The guide agent answers in the context of the current knowledge point.
Request body
Session identifier.
The user’s message or question.
POST /api/v1/guide/fix_html
Fix a bug in the interactive HTML exercise generated for the current knowledge point.
Request body
Session identifier.
Description of the issue to fix.
GET /api/v1/guide/session/{session_id}
Get the current state of a session, including progress and active knowledge point.
Session identifier.
404 if the session is not found.
GET /api/v1/guide/session/{session_id}/html
Get the HTML content for the current knowledge point’s interactive exercise.
Session identifier.
404 if the session is not found or no HTML has been generated yet.
WS /api/v1/guide/ws/{session_id}
WebSocket endpoint for real-time guided learning interaction. Use this instead of the individual REST endpoints when you need lower latency or a persistent connection.
An existing session ID created via
POST /create_session.Client messages
Send JSON objects with atype field:
type | Additional fields | Description |
|---|---|---|
start | — | Start learning (get first knowledge point) |
next | — | Advance to the next knowledge point |
chat | message: string | Send a chat message |
fix_html | bug_description: string | Request an HTML fix |
get_session | — | Retrieve the current session state |
Server messages
type | Payload | Description |
|---|---|---|
task_id | task_id: string | Sent on connection |
session_info | data: object | Session state, sent on connection and in response to get_session |
start_result | data: object | Response to start |
next_result | data: object | Response to next |
chat_result | data: object | Response to chat |
fix_result | data: object | Response to fix_html |
error | content: string | Error message |