Skip to content

Commit 832e523

Browse files
authored
docs(ai-perso): add ai-personalization spec file for documentation generation (#4063)
1 parent e50f0f6 commit 832e523

File tree

17 files changed

+646
-1
lines changed

17 files changed

+646
-1
lines changed

scripts/common.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,13 @@ export const GENERATORS = Object.entries(clientsConfig).reduce(
6969

7070
export const LANGUAGES = [...new Set(Object.values(GENERATORS).map((gen) => gen.language))];
7171

72-
export const CLIENTS = [...new Set(Object.values(GENERATORS).map((gen) => gen.client)), 'crawler'];
72+
// `crawler` and `ai-personalization` are manually added so we can still bundled and validate the specs
73+
// the entry can be removed once at least one client is generated
74+
export const CLIENTS = [
75+
...new Set(Object.values(GENERATORS).map((gen) => gen.client)),
76+
'crawler',
77+
'ai-personalization',
78+
];
7379

7480
export async function run(command: string, { errorMessage, cwd, language }: RunOptions = {}): Promise<string> {
7581
const realCwd = path.resolve(ROOT_DIR, cwd ?? '.');
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
errorCodes:
2+
title: errorCodes
3+
type: string
4+
enum:
5+
- blocked
6+
- deleted
7+
- no_perso_access
8+
- all_attr_value_filtered
9+
- missing_index
10+
- no_events_last_30_days
11+
- pending_pipelines
12+
- invalid_config
13+
14+
status:
15+
title: status
16+
type: string
17+
enum: [pending, active, paused]
18+
19+
sourceType:
20+
title: type
21+
type: string
22+
enum: [insights]
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
description: Bad request.
2+
content:
3+
application/json:
4+
schema:
5+
$ref: './BaseResponse.yml'
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
type: object
2+
properties:
3+
status:
4+
type: integer
5+
description: HTTP status code.
6+
message:
7+
type: string
8+
description: Details about the response, such as error messages.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
description: Configuration not found.
2+
content:
3+
application/json:
4+
schema:
5+
$ref: './BaseResponse.yml'
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
description: Internal server error.
2+
content:
3+
application/json:
4+
schema:
5+
$ref: './BaseResponse.yml'
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
description: Invalid user ID format.
2+
content:
3+
application/json:
4+
schema:
5+
$ref: './BaseResponse.yml'
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
description: Not authorized to access this resource.
2+
content:
3+
application/json:
4+
schema:
5+
$ref: './BaseResponse.yml'
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
description: User not found.
2+
content:
3+
application/json:
4+
schema:
5+
$ref: './BaseResponse.yml'
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
event:
2+
type: object
3+
properties:
4+
type:
5+
$ref: '#/eventType'
6+
subtype:
7+
$ref: '#/subtype'
8+
name:
9+
type: string
10+
required: [type, name]
11+
12+
events:
13+
type: object
14+
properties:
15+
viewDetails:
16+
type: array
17+
items:
18+
$ref: '#/event'
19+
viewListing:
20+
type: array
21+
items:
22+
$ref: '#/event'
23+
addToCart:
24+
type: array
25+
items:
26+
$ref: '#/event'
27+
purchase:
28+
type: array
29+
items:
30+
$ref: '#/event'
31+
required: [viewDetails, viewListing, addToCart, purchase]
32+
33+
issue:
34+
type: object
35+
description: An issue is either an 'error' or a 'warning' that is generated by the validator.
36+
properties:
37+
code:
38+
type: string
39+
index:
40+
type: string
41+
message:
42+
type: string
43+
required: [code, index, message]
44+
45+
personalizationReRanking:
46+
type: string
47+
description: The impact that personalization has on the re-ranking of search results.
48+
enum: [none, low, medium, high, maximum]
49+
50+
profileType:
51+
type: string
52+
enum: [basic, predictive]
53+
description: |
54+
The type of user profiles to generate.
55+
56+
Basic profiles are based on past behaviors, ensuring search results align with previous interests.
57+
Predictive profiles are AI-powered profiles that predict and adapt to users' interests, ensuring search results align with evolving preferences.
58+
59+
eventType:
60+
type: string
61+
enum: [view, click, conversion]
62+
63+
subtype:
64+
type: string
65+
enum: [addToCart, purchase]
66+
67+
status:
68+
type: object
69+
properties:
70+
type:
71+
$ref: '../enums.yml#/status'
72+
errors:
73+
type: array
74+
items:
75+
$ref: '../enums.yml#/errorCodes'

0 commit comments

Comments
 (0)