-
Notifications
You must be signed in to change notification settings - Fork 0
API Reference
This section details the API endpoints provided by the Chat-Service. These are primarily defined in the src/routes/ directory.
Endpoints defined in src/routes/debug.py.
-
GET /api/debug/logs
- Description: Returns in-memory logs for progress and failures. Useful for debugging the service's current state.
- Request Body: None.
- Response:
{ "progressLog": [ /* list of progress entries */ ], "failureLog": [ /* list of failure entries */ ] }
Endpoints defined in src/routes/progress.py. These are used for tracking task completion, potentially for user-facing objectives or internal processes.
-
POST /api/progress/initializeTasks
- Description: Initializes a list of tasks, including their subtasks and steps. This can be used to set up a new set of trackable items.
- Request Body:
{ "items": [ { "taskName": "string", "status": "pending", // or "started", "complete" "subtaskProgress": [ { "subtaskName": "string", "status": "pending" // or "started", "complete" } ], "startedAt": "datetime string (optional)", "completedAt": "datetime string (optional)" } ] } - Response:
{ "message": "Tasks initialized", "data": { /* the taskHierarchy sent in the request */ } }
-
POST /api/progress/updateTask
- Description: Handles updates to task progress (e.g., marking as started or complete).
- Request Body:
{ "taskName": "string", "status": "started", // or "pending", "complete" "subtaskProgress": [ /* same structure as in initializeTasks */ ], "startedAt": "datetime string (optional)", "completedAt": "datetime string (optional)" } - Response:
{ "message": "Progress updated" / "Progress received" / "Task completed", "data": { /* updated or new task entry */ } } - Notes: If a task is "started" or "pending" and already exists as incomplete, it's updated. If new, it's added. If "complete", an existing active task is marked as completed.
-
GET /api/progress
- Description: Returns the entire in-memory log of progress entries.
- Request Body: None.
- Response:
[ /* list of progress data entries */ ]
Endpoint defined in src/routes/upload.py. Used for uploading documents for context, used for the RAG Service.
-
POST /upload/
- Description: Receives a document file, processes it (e.g., for embedding), and stores it.
- Request Parameters:
-
file: The document file to upload (e.g., .txt, .md). Sent asmultipart/form-data. -
category(optional query parameter): The category of the document. Defaults to "General Information".- Possible values include: "Behavioral Context", "General Information", "Conversational Assets", "Training Data", "Miscellaneous", "FishFeeding", "Laboratory", "FishFactory", "FishWelfare", "FishMaintenance", "Ocean".
-
- Response (Success):
{ "message": "File uploaded and processed successfully", "category": "string" // The category used } - Response (Error):
(HTTP 500 for processing failures, or other relevant HTTP error codes)
{ "detail": "Error message" }
This endpoint's definition and location are yet to be fully confirmed from the codebase. It's expected to handle interactions with the LLM.
-
POST /chat (Example Path)
- Description: Sends text to the LLM for a response, potentially using RAG.
- Request Body (Example):
{ "question": "User's query.", "user_information": ["unique_user_identifier"], "progress": [ /* list of ProgressData objects - definition TBD */ ], "user_actions": [ /* list of strings describing user actions */ ], "base_prompt": "System-level instructions for the LLM.", "context": "Relevant contextual information as a string." } - Response (Example):
{ "response_text": "LLM generated response.", "source_documents": [ /* If RAG is used */ ] }
Authors:
Peter Olai Johnsen
Tobias Fremming
Erik Le Blanc Pleym
About Chat-Service
Core Components
Development
Codebase Details
- Codebase Architecture
- Routes
- Command-py
- Config-py
- Context Upload-py
- LLM-py
- Main-py
- Pipeline-py
- Streaming WS-py
- Transcribe-py
Deployment and Operations