SECUREXSECURITY ENGINEERINGNVR 文档

Agnes

通过 OpenAI 兼容接口把 Agnes 用于聊天和视频描述。

示例

genai:
  agnes:
    provider: openai
    api_key: YOUR_API_KEY
    model: agnes-2.0-flash
    base_url: https://apihub.agnes-ai.com/v1
    roles:
      - chat
      - descriptions
    provider_options:
      context_size: 256000
密钥

文档、截图、Git 仓库和论坛中不要公开真实 API Key。

中文描述

在对象描述 Prompt 中明确要求“仅使用简体中文回答”,并在 Review / 描述设置中选择中文偏好。

Agnes

Generative AI converts visual events into natural-language descriptions, Review summaries, or chat answers. Securex NVR can use OpenAI-compatible cloud gateways or local AI providers. Keep API keys in environment variables rather than public configuration or screenshots.

Providers and roles

RolePurpose
chatInteractive chat/question answering.
descriptionsGenerate descriptions for tracked objects/events.
embeddingsVector embeddings for semantic features when supported by the selected provider/build.

OpenAI-compatible example

genai:
  agnes:
    provider: openai
    api_key: ${GENAI_API_KEY}
    model: agnes-2.0-flash
    base_url: https://example-ai-gateway/v1
    roles:
      - chat
      - descriptions
    provider_options:
      context_size: 256000

Language control

If a model defaults to English, state the desired language explicitly in the object/Review prompt. A preferred-language setting only affects features that honor it; it is not a replacement for prompt-level output constraints.

Local AI

Local providers improve privacy and offline capability, but the selected model must actually support vision and the endpoint must match the expected compatibility API. A text-only model cannot reliably describe event images.

Troubleshooting

ErrorTypical cause
401/403API key, authorization header, or reverse-proxy authentication.
404Wrong base_url or compatibility route.
500Upstream provider/model failure or unsupported input.
Generation never finishesModel download, unsupported vision path, timeout, or insufficient GPU/RAM.
Wrong languagePrompt, model capability, or requests reaching a different provider than expected.

Validation sequence

  1. Test a text request directly against the provider.
  2. Test a single-image vision request.
  3. Enable descriptions.
  4. Add Review summaries, chat, and semantic features only after the base path is reliable.

Agnes

La IA generativa convierte eventos visuales en descripciones, resúmenes de Review o respuestas de chat. Securex NVR puede usar gateways compatibles con OpenAI o proveedores locales. Guarde las claves en variables de entorno.

Provider y roles

RolUso
chatChat y preguntas.
descriptionsDescripciones de objetos/eventos.
embeddingsVectores para funciones semánticas cuando estén soportadas.

Ejemplo compatible con OpenAI

genai:
  agnes:
    provider: openai
    api_key: ${GENAI_API_KEY}
    model: agnes-2.0-flash
    base_url: https://example-ai-gateway/v1
    roles:
      - chat
      - descriptions
    provider_options:
      context_size: 256000

Idioma

Si el modelo responde en inglés, exija explícitamente el idioma en el prompt. preferred_language no sustituye las reglas del prompt.

IA local

Un provider local mejora privacidad, pero el modelo debe soportar visión y el endpoint debe ser compatible. Un modelo solo de texto no puede describir imágenes de eventos de forma fiable.

Diagnóstico

ErrorCausa habitual
401/403Clave o autenticación/proxy.
404base_url/ruta incorrecta.
500Fallo del proveedor/modelo.
No terminaDescarga, visión no soportada, timeout o recursos insuficientes.
Idioma incorrectoPrompt, modelo o provider equivocado.

Secuencia de prueba

  1. Pruebe texto directamente.
  2. Pruebe una imagen.
  3. Active descriptions.
  4. Después active resumen, chat y funciones semánticas.
输入关键词开始搜索