Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

API endpoint to create workspace prompt (custom context/instruction) #660

Description

@lxmcgvrn

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions