daveadmin e768662efe Add Summarize Document tool — engine selector, file upload, optional corpus enrichment
- summarize.php: full custom inline form (replaces tool_form.php wrapper) with
  lang switcher, azure_mini/azure_full/gpu engine selector, 8 corpus-slice
  toggles (all off by default), doc picker, file upload zone, and textarea
- api/summarize.php: rewritten to streaming NDJSON (matches barnevernet pattern);
  accepts JSON payload with text, language, engine, slices[], doc_ids[]
- includes/LegalTools.php: adds corpusContextForSummarize() (keyword search via
  ClientRagPipeline) and summarizeWithContext() (engine-aware LLM call with
  optional corpus prepend); returns structured JSON matching existing summarize format
- assets/js/summarize.js: self-contained IIFE handling file upload via
  api/extract.php, slice toggles, NDJSON stream reader, result rendering,
  and trace panel update
- includes/i18n.php: adds 'summarize' to nav in all 4 languages (EN/NO/UK/PL),
  inserted after 'redact' in the tool order with icon 'SZ'

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-23 23:25:40 +02:00
2026-05-23 10:17:34 +02:00
2026-05-23 10:17:34 +02:00
2026-05-23 10:17:34 +02:00
2026-05-23 10:17:34 +02:00
2026-05-23 10:17:34 +02:00
2026-05-23 10:17:34 +02:00
2026-05-23 10:17:34 +02:00
2026-05-23 10:17:34 +02:00
2026-05-23 10:17:34 +02:00
2026-05-08 17:12:38 +02:00

Do Better Norge Legal Tools Hub

MVP docroot for tools.dobetternorge.no.

Required environment

  • CaveauAI client access for DBN_CAVEAU_CLIENT_SLUG and DBN_CAVEAU_PACKAGE_SLUG
  • DBN_AZURE_OPENAI_ENDPOINT
  • DBN_AZURE_OPENAI_API_KEY
  • DBN_AZURE_OPENAI_API_VERSION
  • DBN_AZURE_OPENAI_CHAT_DEPLOYMENT
  • DBN_AZURE_OPENAI_EMBEDDING_DEPLOYMENT

Optional:

  • DBN_AI_PORTAL_ROOT (defaults to sibling ai-portal)
  • DBN_CAVEAU_CLIENT_SLUG (defaults to dobetter)
  • DBN_CAVEAU_PACKAGE_SLUG (defaults to family-legal)
  • DBN_TOOLS_SUPPORT_DIR
  • DBN_TOOLS_METADATA_LOG

Authentication

The login form authenticates against Caveau client_users for the configured client slug. The client must be active, the user must be active, and the client must have an active subscription to the configured corpus package.

Use scripts/setup-caveau-access.php for repeatable local/production setup of the Do Better Norge Caveau owner account, family-legal subscription, and white-label domain mappings. Pass the account password through DBN_SETUP_PASSWORD at runtime only; do not commit it.

The APIs process pasted text in memory and write only metadata such as tool name, latency, language, source count, chunk count, deployment, and anonymous session id.

S
Description
No description provided
Readme 33 MiB
Languages
PHP 77.3%
JavaScript 13.6%
CSS 9.1%