mirror of
https://github.com/StanGirard/quivr.git
synced 2024-12-25 12:22:58 +03:00
f48dab4a7d
# Description Please include a summary of the changes and the related issue. Please also include relevant motivation and context. ## Checklist before requesting a review Please delete options that are not relevant. - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my code - [ ] I have commented hard-to-understand areas - [ ] I have ideally added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged ## Screenshots (if appropriate):
22 lines
470 B
Python
22 lines
470 B
Python
from typing import Optional
|
|
from uuid import UUID
|
|
|
|
from modules.brain.service.brain_service import BrainService
|
|
|
|
brain_service = BrainService()
|
|
|
|
|
|
def get_prompt_to_use_id(
|
|
brain_id: Optional[UUID], prompt_id: Optional[UUID]
|
|
) -> Optional[UUID]:
|
|
if brain_id is None and prompt_id is None:
|
|
return None
|
|
|
|
return (
|
|
prompt_id
|
|
if prompt_id
|
|
else brain_service.get_brain_prompt_id(brain_id)
|
|
if brain_id
|
|
else None
|
|
)
|