add missing doc-strings for tree-manager mandatory labels settings

This commit is contained in:
Andreas Koepf
2023-01-13 16:04:06 +00:00
parent 343853fb57
commit d0ef7c4bbc
2 changed files with 9 additions and 2 deletions
+5
View File
@@ -47,8 +47,13 @@ class TreeManagerConfiguration(BaseModel):
"""Number of rankings in which the message participated."""
mandatory_labels_initial_prompt: Optional[list[protocol_schema.TextLabel]] = [protocol_schema.TextLabel.spam]
"""Mandatory labels in text-labeling tasks for initial prompts."""
mandatory_labels_assistant_reply: Optional[list[protocol_schema.TextLabel]] = [protocol_schema.TextLabel.spam]
"""Mandatory labels in text-labeling tasks for assistant reylies."""
mandatory_labels_prompter_reply: Optional[list[protocol_schema.TextLabel]] = [protocol_schema.TextLabel.spam]
"""Mandatory labels in text-labeling tasks for prompter replies."""
class Settings(BaseSettings):
+4 -2
View File
@@ -68,9 +68,11 @@ class IncompleteRankingsRow(pydantic.BaseModel):
class TreeManager:
_all_text_labels = list(map(lambda x: x.value, protocol_schema.TextLabel))
def __init__(self, db: Session, prompt_repository: PromptRepository):
def __init__(
self, db: Session, prompt_repository: PromptRepository, cfg: Optional[TreeManagerConfiguration] = None
):
self.db = db
self.cfg = settings.tree_manager
self.cfg = cfg or settings.tree_manager
self.pr = prompt_repository
def _task_selection(