prompts
Classes
PromptsClient
PromptsClient(client: OWUIClientBase)
Bases: ResourceBase
Client for the Prompts endpoints.
- Code Reference client Classes OpenWebUI Attributes prompts
Source code in src/owui_client/client_base.py
Functions
get_prompts
get_prompts() -> List[PromptModel]
Get all prompts (read access).
Returns:
| Type | Description |
|---|---|
List[PromptModel]
|
List[PromptModel]: List of prompts. |
get_prompt_list
get_prompt_list() -> List[PromptUserResponse]
Get all prompts with user info (write access).
Returns:
| Type | Description |
|---|---|
List[PromptUserResponse]
|
List[PromptUserResponse]: List of prompts with user details. |
Source code in src/owui_client/routers/prompts.py
create_new_prompt
create_new_prompt(
form_data: PromptForm,
) -> Optional[PromptModel]
Create a new prompt.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
form_data
|
PromptForm
|
The prompt data. The |
required |
Returns:
| Type | Description |
|---|---|
Optional[PromptModel]
|
Optional[PromptModel]: The created prompt. |
Source code in src/owui_client/routers/prompts.py
get_prompt_by_command
get_prompt_by_command(
command: str,
) -> Optional[PromptModel]
Get a prompt by command.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
command
|
str
|
The command trigger (e.g., 'help' or '/help'). Leading slash is automatically handled. |
required |
Returns:
| Type | Description |
|---|---|
Optional[PromptModel]
|
Optional[PromptModel]: The prompt details. |
Source code in src/owui_client/routers/prompts.py
update_prompt_by_command
update_prompt_by_command(
command: str, form_data: PromptForm
) -> Optional[PromptModel]
Update a prompt by command.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
command
|
str
|
The command trigger (e.g., 'help' or '/help'). Leading slash is automatically handled. |
required |
form_data
|
PromptForm
|
The updated prompt data. |
required |
Returns:
| Type | Description |
|---|---|
Optional[PromptModel]
|
Optional[PromptModel]: The updated prompt. |
Source code in src/owui_client/routers/prompts.py
delete_prompt_by_command
Delete a prompt by command.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
command
|
str
|
The command trigger (e.g., 'help' or '/help'). Leading slash is automatically handled. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if successful. |