mirror of
https://github.com/koala73/worldmonitor.git
synced 2026-04-25 17:14:57 +02:00
perf(api): convert POST RPCs to GET for CDN caching (#795)
* perf(api): convert classify-event to GET and add summarize-article cache endpoint for CDN caching classify-event (7.9M calls/wk) was POST — bypassing all CDN caching. Converting to GET with static cache tier (1hr) enables Cloudflare edge caching. Degraded responses (no API key, empty title, errors) are marked no-cache to prevent caching error states. summarize-article has repeated headlines too large for URL params. Added a new GetSummarizeArticleCache GET endpoint that looks up Redis by a deterministic cache key. Client computes key via shared buildSummaryCacheKey(), tries GET first (CDN-cacheable), falls back to existing POST on miss. Shared module ensures client/server key parity. * fix(types): wire missing DeductSituation and ListGulfQuotes RPCs, fix tsc errors - Added DeductSituation RPC to intelligence/v1/service.proto (messages existed, RPC declaration was missing) - Added ListGulfQuotes proto + RPC to market/v1/service.proto (handler existed, proto was missing) - Fixed scrapedAt type mismatch in conflict/index.ts (int64 → string) - Added @ts-nocheck to generated files with codegen type bugs - Regenerated all sebuf client/server code * fix(types): fix int64→string type mismatch in list-iran-events.ts
This commit is contained in:
@@ -70,18 +70,37 @@ paths:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Error'
|
||||
/api/intelligence/v1/classify-event:
|
||||
post:
|
||||
get:
|
||||
tags:
|
||||
- IntelligenceService
|
||||
summary: ClassifyEvent
|
||||
description: ClassifyEvent classifies a real-world event using AI (Groq).
|
||||
operationId: ClassifyEvent
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ClassifyEventRequest'
|
||||
required: true
|
||||
parameters:
|
||||
- name: title
|
||||
in: query
|
||||
description: Event title or headline.
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
- name: description
|
||||
in: query
|
||||
description: Event description or body text.
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
- name: source
|
||||
in: query
|
||||
description: Event source (e.g., "reuters", "acled").
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
- name: country
|
||||
in: query
|
||||
description: Country context (ISO 3166-1 alpha-2).
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
description: Successful response
|
||||
@@ -112,7 +131,7 @@ paths:
|
||||
- name: country_code
|
||||
in: query
|
||||
description: ISO 3166-1 alpha-2 country code.
|
||||
required: true
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
@@ -199,7 +218,7 @@ paths:
|
||||
tags:
|
||||
- IntelligenceService
|
||||
summary: DeductSituation
|
||||
description: DeductSituation deducts the future situation based on query and context using an LLM.
|
||||
description: DeductSituation performs AI-powered situational analysis and deduction.
|
||||
operationId: DeductSituation
|
||||
requestBody:
|
||||
content:
|
||||
|
||||
Reference in New Issue
Block a user