Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/marble-api/openapis/marblecore-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ paths:
$ref: ./marblecore-api/cases.yml#/~1cases~1{caseId}~1review~1{reviewId}~1feedback
/cases/{caseId}/data_for_investigation:
$ref: ./marblecore-api/cases.yml#/~1cases~1{caseId}~1data_for_investigation
/cases/{caseId}/enrich_kyc:
$ref: ./marblecore-api/cases.yml#/~1cases~1{caseId}~1enrich_kyc

# SUSPICIOUS ACTIVITY REPORTS

Expand Down
4 changes: 4 additions & 0 deletions packages/marble-api/openapis/marblecore-api/_schemas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ FloatFieldStatisticsDto:
$ref: ingestion.yml#/components/schemas/FloatFieldStatisticsDto
TimestampFieldStatisticsDto:
$ref: ingestion.yml#/components/schemas/TimestampFieldStatisticsDto
KYCAnalysisDto:
$ref: cases.yml#/components/schemas/KYCAnalysisDto
GroundingCitationDto:
$ref: cases.yml#/components/schemas/GroundingCitationDto

# SUSPICIOUS ACTIVITY REPORTS

Expand Down
74 changes: 73 additions & 1 deletion packages/marble-api/openapis/marblecore-api/cases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -834,6 +834,38 @@
format: binary
'401':
$ref: 'components.yml#/responses/401'
/cases/{caseId}/enrich_kyc:
post:
tags:
- Cases
summary: Enrich the pivot object of the case with KYC data (if present)
operationId: enrichPivotObjectOfCaseWithKyc
security:
- bearerAuth: []
parameters:
- name: caseId
description: ID of the case
in: path
required: true
schema:
type: string
format: uuid
responses:
'200':
description: Analysis of the pivot object of the case with KYC data
content:
application/json:
schema:
type: object
properties:
results:
type: array
items:
$ref: '#/components/schemas/KYCAnalysisDto'
'401':
$ref: 'components.yml#/responses/401'
'403':
$ref: 'components.yml#/responses/403'

components:
schemas:
Expand Down Expand Up @@ -1552,4 +1584,44 @@ components:
type: string
enum: ['ok', 'ko']
description: The reaction to the review, can be null if not set or removed
nullable: true
nullable: true

GroundingCitationDto:
type: object
required:
- title
- domain
- url
- date
properties:
title:
type: string
description: Title of the source
domain:
type: string
description: Domain of the source (not used for now)
url:
type: string
description: URL of the source
date:
type: string
format: date-time
description: Date of the source
KYCAnalysisDto:
type: object
required:
- analysis
- entity_name
- citations
properties:
analysis:
type: string
description: Output of LLM analysis on a pivot object
entity_name:
type: string
description: Name of the entity on which the pivot value is found.
citations:
type: array
description: List of source used in the analysis. The analysis uses anchors ([1][2]), these anchors are used to justify the analysis and the index follow the list order
items:
$ref: '#/components/schemas/GroundingCitationDto'
38 changes: 38 additions & 0 deletions packages/marble-api/src/generated/marblecore-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,24 @@ export type CaseReviewDto = {
version: string;
review: CaseReviewContentDto;
};
export type GroundingCitationDto = {
/** Title of the source */
title: string;
/** Domain of the source (not used for now) */
domain: string;
/** URL of the source */
url: string;
/** Date of the source */
date: string;
};
export type KycAnalysisDto = {
/** Output of LLM analysis on a pivot object */
analysis: string;
/** Name of the entity on which the pivot value is found. */
entity_name: string;
/** List of source used in the analysis. The analysis uses anchors ([1][2]), these anchors are used to justify the analysis and the index follow the list order */
citations: GroundingCitationDto[];
};
export type SuspiciousActivityReportDto = {
id: string;
status: "pending" | "completed";
Expand Down Expand Up @@ -1971,6 +1989,26 @@ export function downloadCaseData(caseId: string, opts?: Oazapfts.RequestOpts) {
...opts
}));
}
/**
* Enrich the pivot object of the case with KYC data (if present)
*/
export function enrichPivotObjectOfCaseWithKyc(caseId: string, opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
status: 200;
data: {
results?: KycAnalysisDto[];
};
} | {
status: 401;
data: string;
} | {
status: 403;
data: string;
}>(`/cases/${encodeURIComponent(caseId)}/enrich_kyc`, {
...opts,
method: "POST"
}));
}
/**
* List suspicious activity reports for a case
*/
Expand Down