from pydantic import AnyUrl, Field, SecretStr
from maur.settings import SettingsModel


prompt_template = "An alert was detected! Try to setup an unit test to replicate the issue, and then update the codebase so the test passes.\n\n# {body.title}\n\n{body.message}\n\nValues: {alert.values}"

class GrafanaSettings(SettingsModel):
    match_labels: dict[str, str] | None = Field(default={"maur": "true"})
    repo_branch: str = Field(default="main")
    prompt_template: str = Field(default=prompt_template)


class LokiSettings(SettingsModel):
    loki_url: AnyUrl
    loki_token: SecretStr
