This repository was archived by the owner on Jun 5, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 91
API endpoint to create workspace prompt (custom context/instruction)Β #660
Copy link
Copy link
Closed
Copy link
Labels
Description
The functionality for letting a user create custom prompts is already implemented in #643
All that seems to be missing is exposing a POST endpoint (for the dashboard to use) to allow setting a prompt without using the LLM/CLI. It should be a simple wrapper around update_workspace_system_prompt
codegate/src/codegate/workspaces/crud.py
Lines 82 to 97 in c140e65
| async def update_workspace_system_prompt( | |
| self, workspace_name: str, sys_prompt_lst: List[str] | |
| ) -> Workspace: | |
| selected_workspace = await self._db_reader.get_workspace_by_name(workspace_name) | |
| if not selected_workspace: | |
| raise WorkspaceDoesNotExistError(f"Workspace {workspace_name} does not exist.") | |
| system_prompt = " ".join(sys_prompt_lst) | |
| workspace_update = Workspace( | |
| id=selected_workspace.id, | |
| name=selected_workspace.name, | |
| system_prompt=system_prompt, | |
| ) | |
| db_recorder = DbRecorder() | |
| updated_workspace = await db_recorder.update_workspace(workspace_update) | |
| return updated_workspace |