Refactor Review GenAI Prompt (#22353)

* Improve title to better capture activity

* Improve efficiency of prompt

* Use json format for llama.cpp

* Cleanup prompt

* Add output format for other LLMs
This commit is contained in:
Nicolas Mowen
2026-03-09 18:47:37 -06:00
committed by GitHub
parent e75b8ca6cc
commit 5254bfd00e
7 changed files with 102 additions and 40 deletions

View File

@@ -4,20 +4,24 @@ from pydantic import BaseModel, ConfigDict, Field
class ReviewMetadata(BaseModel):
model_config = ConfigDict(extra="ignore", protected_namespaces=())
title: str = Field(description="A concise title for the activity.")
title: str = Field(
description="A short title characterizing what took place and where, under 10 words."
)
scene: str = Field(
description="A comprehensive description of the setting and entities, including relevant context and plausible inferences if supported by visual evidence."
description="A chronological narrative of what happens from start to finish."
)
shortSummary: str = Field(
description="A brief 2-sentence summary of the scene, suitable for notifications. Should capture the key activity and context without full detail."
description="A brief 2-sentence summary of the scene, suitable for notifications."
)
confidence: float = Field(
description="A float between 0 and 1 representing your overall confidence in this analysis."
ge=0.0,
le=1.0,
description="Confidence in the analysis, from 0 to 1.",
)
potential_threat_level: int = Field(
ge=0,
le=3,
description="An integer representing the potential threat level (1-3). 1: Minor anomaly. 2: Moderate concern. 3: High threat. Only include this field if a clear security concern is observable; otherwise, omit it.",
le=2,
description="Threat level: 0 = normal, 1 = suspicious, 2 = critical threat.",
)
other_concerns: list[str] | None = Field(
default=None,