mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-03-17 21:58:22 +03:00
Add sub label to event tool filtering
This commit is contained in:
parent
2ddd55c470
commit
994a5acc52
@ -105,12 +105,16 @@ def get_tool_definitions() -> List[Dict[str, Any]]:
|
|||||||
"properties": {
|
"properties": {
|
||||||
"camera": {
|
"camera": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "Camera name to filter by (optional). Use 'all' for all cameras.",
|
"description": "Camera name to filter by (optional).",
|
||||||
},
|
},
|
||||||
"label": {
|
"label": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "Object label to filter by (e.g., 'person', 'package', 'car').",
|
"description": "Object label to filter by (e.g., 'person', 'package', 'car').",
|
||||||
},
|
},
|
||||||
|
"sub_label": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Sub-label to filter by: name of a person, delivery company, animal, etc.",
|
||||||
|
},
|
||||||
"after": {
|
"after": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "Start time in ISO 8601 format (e.g., '2024-01-01T00:00:00Z').",
|
"description": "Start time in ISO 8601 format (e.g., '2024-01-01T00:00:00Z').",
|
||||||
@ -165,14 +169,13 @@ def get_tool_definitions() -> List[Dict[str, Any]]:
|
|||||||
summary="Get available tools",
|
summary="Get available tools",
|
||||||
description="Returns OpenAI-compatible tool definitions for function calling.",
|
description="Returns OpenAI-compatible tool definitions for function calling.",
|
||||||
)
|
)
|
||||||
def get_tools(request: Request) -> JSONResponse:
|
def get_tools() -> JSONResponse:
|
||||||
"""Get list of available tools for LLM function calling."""
|
"""Get list of available tools for LLM function calling."""
|
||||||
tools = get_tool_definitions()
|
tools = get_tool_definitions()
|
||||||
return JSONResponse(content={"tools": tools})
|
return JSONResponse(content={"tools": tools})
|
||||||
|
|
||||||
|
|
||||||
async def _execute_search_objects(
|
async def _execute_search_objects(
|
||||||
request: Request,
|
|
||||||
arguments: Dict[str, Any],
|
arguments: Dict[str, Any],
|
||||||
allowed_cameras: List[str],
|
allowed_cameras: List[str],
|
||||||
) -> JSONResponse:
|
) -> JSONResponse:
|
||||||
@ -214,10 +217,9 @@ async def _execute_search_objects(
|
|||||||
|
|
||||||
# Build query parameters compatible with EventsQueryParams
|
# Build query parameters compatible with EventsQueryParams
|
||||||
query_params = EventsQueryParams(
|
query_params = EventsQueryParams(
|
||||||
camera=arguments.get("camera", "all"),
|
|
||||||
cameras=arguments.get("camera", "all"),
|
cameras=arguments.get("camera", "all"),
|
||||||
label=arguments.get("label", "all"),
|
|
||||||
labels=arguments.get("label", "all"),
|
labels=arguments.get("label", "all"),
|
||||||
|
sub_labels=arguments.get("sub_label", "all"),
|
||||||
zones=zones,
|
zones=zones,
|
||||||
zone=zones,
|
zone=zones,
|
||||||
after=after,
|
after=after,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user