-
Notifications
You must be signed in to change notification settings - Fork 27
feat(clients): add new realtime-personalization api #4613
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
75fdf13
feat(realtime-perso): add new realtime-perso api
8828aa5
update api url and path
3dfbf35
Merge remote-tracking branch 'origin/main' into PRED-3652/realtime-pe…
2526e89
update path and schemas
8ee8999
update clients config
dedef01
Merge remote-tracking branch 'origin/main' into PRED-3652/realtime-pe…
ca169fe
Merge remote-tracking branch 'origin/main' into PRED-3652/realtime-pe…
283ce30
try without additionalPropoerties
a2965f7
rollback change
e54f457
Merge branch 'main' into PRED-3652/realtime-perso-api
benamib 0d9a3c8
fix: go
shortcuts 9d48a55
chore: playground and javascript
shortcuts af4f5ea
chore: go cts
shortcuts 2b5bc83
chore: add a test
shortcuts 533cf7b
chore: dart
shortcuts 16c351d
chore: client tests
shortcuts d84057a
chore: generation issues
shortcuts b355500
chore: pre-release
shortcuts ee86911
chore: lock
shortcuts 043b672
chore: dart
shortcuts 9d643d6
chore: build
shortcuts 4f7426b
chore: cts
shortcuts 7ec3c20
chore: cts
shortcuts efac20c
chore: cts
shortcuts d9c9219
chore: js snippets
shortcuts File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,8 @@ | ||||||
| # path | ||||||
| UserToken: | ||||||
| name: userToken | ||||||
| in: path | ||||||
| required: true | ||||||
| description: Unique identifier representing a user for which to fetch the personalization profile. | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| schema: | ||||||
| $ref: '../../common/schemas/SearchParams.yml#/userToken' | ||||||
20 changes: 20 additions & 0 deletions
20
specs/realtime-personalization/common/schemas/personalizationFilters.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| personalizationFilters: | ||
benamib marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| type: object | ||
| additionalProperties: false | ||
| required: | ||
| - version | ||
| - userID | ||
| - search | ||
| properties: | ||
| version: | ||
| type: string | ||
| description: Version of the response format. | ||
| userID: | ||
| type: string | ||
| description: User ID of the user. | ||
| search: | ||
| type: object | ||
| description: | | ||
| Index personalization filters by index name. | ||
| additionalProperties: | ||
| $ref: '#/searchFilters' | ||
30 changes: 30 additions & 0 deletions
30
specs/realtime-personalization/common/schemas/searchFilters.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| searchFilters: | ||
| type: object | ||
| additionalProperties: false | ||
| properties: | ||
| indices: | ||
| type: array | ||
| items: | ||
| type: string | ||
| example: ['storefront', 'storefront_price_asc', 'storefront_price_desc'] | ||
| strategy: | ||
| $ref: '#/strategy' | ||
| filters: | ||
| $ref: '#/searchFilter' | ||
|
|
||
| searchFilter: | ||
| type: object | ||
| additionalProperties: false | ||
| properties: | ||
| session: | ||
| type: array | ||
| items: | ||
| type: string | ||
| example: ['brand:Dyson<score=12>'] | ||
|
|
||
| strategy: | ||
| type: string | ||
| enum: | ||
| - session | ||
| - hybrid | ||
| example: 'session' |
25 changes: 25 additions & 0 deletions
25
specs/realtime-personalization/paths/getPersonalizationFilters.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| get: | ||
| tags: | ||
| - filters | ||
| operationId: getIndexPersonalizationFilters | ||
| x-acl: | ||
| - recommendation | ||
| summary: Retrieve the index personalization filters | ||
| description: Retrieves the current index personalization filters. | ||
| parameters: | ||
| - $ref: '../common/parameters.yml#/UserToken' | ||
| responses: | ||
| '200': | ||
| description: OK | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: '../common/schemas/personalizationFilters.yml#/personalizationFilters' | ||
| '400': | ||
| $ref: '../../common/responses/BadRequest.yml' | ||
| '402': | ||
| $ref: '../../common/responses/FeatureNotEnabled.yml' | ||
| '403': | ||
| $ref: '../../common/responses/MethodNotAllowed.yml' | ||
| '404': | ||
| $ref: '../../common/responses/IndexNotFound.yml' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| openapi: 3.1.0 | ||
| info: | ||
| title: Realtime Personalization API | ||
| description: TODO | ||
| version: 0.0.1 | ||
| externalDocs: | ||
| # TODO: Update the URL | ||
| url: https://www.algolia.com/doc/guides/personalization/what-is-personalization/ | ||
| description: | | ||
| Related guide: Algolia Realtime Personalization. | ||
| components: | ||
| securitySchemes: | ||
| appId: | ||
| $ref: '../common/securitySchemes.yml#/appId' | ||
| apiKey: | ||
| $ref: '../common/securitySchemes.yml#/apiKey' | ||
| servers: | ||
| - url: https://ai-personalization.{region}.algolia.com | ||
benamib marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| variables: | ||
| region: | ||
| enum: | ||
| - us | ||
| - eu | ||
| default: us | ||
| security: | ||
| - appId: [] | ||
| apiKey: [] | ||
benamib marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| tags: | ||
| - name: filters | ||
| x-displayName: Filters | ||
| description: | | ||
| Filters are used to personalize the search results for a user. | ||
| They are used to filter the search results based on the user's preferences. | ||
| x-tagGroups: | ||
| - name: General | ||
| tags: | ||
| - filters | ||
| paths: | ||
| # ###################### | ||
| # ### Custom request ### | ||
| # ###################### | ||
|
|
||
| /2/realtime/{userToken}: | ||
| $ref: 'paths/getPersonalizationFilters.yml' | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We call this
userIDin all the personalization APIs.