Skip to content

Commit b882b31

Browse files
committed
feat(ai): add AI settings endpoint and related schemas to marblecore API
1 parent aa1cc74 commit b882b31

4 files changed

Lines changed: 180 additions & 0 deletions

File tree

packages/marble-api/openapis/marblecore-api.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,11 @@ paths:
344344
/settings/me/unavailable:
345345
$ref: ./marblecore-api/users.yml#/~1settings~1me~1unavailable
346346

347+
# AI
348+
349+
/settings/ai:
350+
$ref: ./marblecore-api/ai.yml#/~1settings~1ai
351+
347352
components:
348353
securitySchemes:
349354
$ref: marblecore-api/_common.yml#/securitySchemes

packages/marble-api/openapis/marblecore-api/_schemas.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,3 +446,14 @@ WorkflowActionCase:
446446

447447
PersonalSettingsUnavailableDto:
448448
$ref: users.yml#/components/schemas/PersonalSettingsUnavailableDto
449+
450+
# AI
451+
452+
KycEnrichmentSettingDto:
453+
$ref: ai.yml#/components/schemas/KycEnrichmentSettingDto
454+
CaseReviewSettingDto:
455+
$ref: ai.yml#/components/schemas/CaseReviewSettingDto
456+
AISettingsDto:
457+
$ref: ai.yml#/components/schemas/AISettingsDto
458+
UpsertAISettingsDto:
459+
$ref: ai.yml#/components/schemas/UpsertAISettingsDto
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
/settings/ai:
2+
get:
3+
tags:
4+
- AI settings
5+
summary: Get the current AI settings
6+
operationId: getAISettings
7+
security:
8+
- bearerAuth: []
9+
responses:
10+
"200":
11+
description: Current AI settings for an organization
12+
content:
13+
application/json:
14+
schema:
15+
$ref: "#/components/schemas/AISettingsDto"
16+
"401":
17+
$ref: "components.yml#/responses/401"
18+
"403":
19+
$ref: "components.yml#/responses/403"
20+
"404":
21+
description: The organization has no AI settings
22+
put:
23+
tags:
24+
- AI settings
25+
summary: Upsert AI settings for an organization
26+
operationId: upsertAISettings
27+
security:
28+
- bearerAuth: []
29+
requestBody:
30+
required: true
31+
content:
32+
application/json:
33+
schema:
34+
$ref: "#/components/schemas/UpsertAISettingsDto"
35+
responses:
36+
"200":
37+
description: AI settings upserted
38+
content:
39+
application/json:
40+
schema:
41+
$ref: "#/components/schemas/AISettingsDto"
42+
"401":
43+
$ref: "components.yml#/responses/401"
44+
"403":
45+
$ref: "components.yml#/responses/403"
46+
47+
components:
48+
schemas:
49+
KycEnrichmentSettingDto:
50+
type: object
51+
properties:
52+
model:
53+
type: string
54+
domain_filter:
55+
type: array
56+
items:
57+
type: string
58+
search_context_size:
59+
type: string
60+
enum:
61+
- low
62+
- medium
63+
- high
64+
CaseReviewSettingDto:
65+
type: object
66+
properties:
67+
org_description:
68+
type: string
69+
language:
70+
type: string
71+
structure:
72+
type: string
73+
74+
AISettingsDto:
75+
type: object
76+
required:
77+
- org_id
78+
- created_at
79+
- updated_at
80+
- kyc_enrichment_setting
81+
- case_review_setting
82+
properties:
83+
org_id:
84+
type: string
85+
format: uuid
86+
created_at:
87+
type: string
88+
format: date-time
89+
updated_at:
90+
type: string
91+
format: date-time
92+
kyc_enrichment_setting:
93+
$ref: "#/components/schemas/KycEnrichmentSettingDto"
94+
case_review_setting:
95+
$ref: "#/components/schemas/CaseReviewSettingDto"
96+
UpsertAISettingsDto:
97+
type: object
98+
required:
99+
- kyc_enrichment_setting
100+
- case_review_setting
101+
properties:
102+
kyc_enrichment_setting:
103+
$ref: "#/components/schemas/KycEnrichmentSettingDto"
104+
case_review_setting:
105+
$ref: "#/components/schemas/CaseReviewSettingDto"

packages/marble-api/src/generated/marblecore-api.ts

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,6 +1302,27 @@ export type WorkflowRuleDetailDto = WorkflowRuleDto & {
13021302
export type PersonalSettingsUnavailableDto = {
13031303
until: string;
13041304
};
1305+
export type KycEnrichmentSettingDto = {
1306+
model?: string;
1307+
domain_filter?: string[];
1308+
search_context_size?: "low" | "medium" | "high";
1309+
};
1310+
export type CaseReviewSettingDto = {
1311+
org_description?: string;
1312+
language?: string;
1313+
structure?: string;
1314+
};
1315+
export type AiSettingsDto = {
1316+
org_id: string;
1317+
created_at: string;
1318+
updated_at: string;
1319+
kyc_enrichment_setting: KycEnrichmentSettingDto;
1320+
case_review_setting: CaseReviewSettingDto;
1321+
};
1322+
export type UpsertAiSettingsDto = {
1323+
kyc_enrichment_setting: KycEnrichmentSettingDto;
1324+
case_review_setting: CaseReviewSettingDto;
1325+
};
13051326
/**
13061327
* Get an access token
13071328
*/
@@ -4712,3 +4733,41 @@ export function cancelUnavailability(opts?: Oazapfts.RequestOpts) {
47124733
method: "DELETE"
47134734
}));
47144735
}
4736+
/**
4737+
* Get the current AI settings
4738+
*/
4739+
export function getAiSettings(opts?: Oazapfts.RequestOpts) {
4740+
return oazapfts.ok(oazapfts.fetchJson<{
4741+
status: 200;
4742+
data: AiSettingsDto;
4743+
} | {
4744+
status: 401;
4745+
data: string;
4746+
} | {
4747+
status: 403;
4748+
data: string;
4749+
} | {
4750+
status: 404;
4751+
}>("/settings/ai", {
4752+
...opts
4753+
}));
4754+
}
4755+
/**
4756+
* Upsert AI settings for an organization
4757+
*/
4758+
export function upsertAiSettings(upsertAiSettingsDto: UpsertAiSettingsDto, opts?: Oazapfts.RequestOpts) {
4759+
return oazapfts.ok(oazapfts.fetchJson<{
4760+
status: 200;
4761+
data: AiSettingsDto;
4762+
} | {
4763+
status: 401;
4764+
data: string;
4765+
} | {
4766+
status: 403;
4767+
data: string;
4768+
}>("/settings/ai", oazapfts.json({
4769+
...opts,
4770+
method: "PUT",
4771+
body: upsertAiSettingsDto
4772+
})));
4773+
}

0 commit comments

Comments
 (0)