2023-08-22 15:23:27 +03:00
|
|
|
from typing import Optional
|
|
|
|
from uuid import UUID
|
|
|
|
|
2024-04-20 12:28:20 +03:00
|
|
|
from modules.brain.service.utils.get_prompt_to_use_id import get_prompt_to_use_id
|
2023-11-23 16:13:21 +03:00
|
|
|
from modules.prompt.service import PromptService
|
|
|
|
|
|
|
|
promptService = PromptService()
|
2023-08-22 15:23:27 +03:00
|
|
|
|
|
|
|
|
2024-02-15 01:01:35 +03:00
|
|
|
def get_prompt_to_use(brain_id: Optional[UUID], prompt_id: Optional[UUID]) -> str:
|
2023-08-22 15:23:27 +03:00
|
|
|
prompt_to_use_id = get_prompt_to_use_id(brain_id, prompt_id)
|
|
|
|
if prompt_to_use_id is None:
|
|
|
|
return None
|
|
|
|
|
2023-11-23 16:13:21 +03:00
|
|
|
return promptService.get_prompt_by_id(prompt_to_use_id)
|