Changelog

Recommendation

Release notes for aice-recommendation and @aiceafrica/recommendation.

Python: aice-recommendation

0.1.0 (unreleased)

Rebuilt on aice-core, the shared transport every AICE SDK uses.

Changed (breaking)

  • Clients authenticate with the console project key, whose scopes must include reco, and take max_retries, user_id and user_role. Retries, request ids and error mapping come from aice-core.
  • Clients take vertical= (for example "ecommerce"), and every data call needs it: the engine serves users, items, ingest, recommend, train and config under /{vertical}/…. Pass the bare host as base_url; a base_url ending with the vertical is refused. Without vertical, data calls raise ValueError before sending anything. list_verticals / get_vertical work with or without one.
  • Errors subclass both RecommendationError and the matching aice-core error, so except aice_core.AuthenticationError also catches this SDK's. ForbiddenError is removed: a 403 raises RecommendationError with status_code == 403.
  • recommend() no longer takes persist.

Added

  • delete_item and anonymise_user (right to erasure).
  • Training: train(run_after=…), reschedule_job, cancel_job, and get_schedule / set_schedule / delete_schedule (TrainSchedule; get_schedule returns None when there is no schedule).
  • get_config_schema().
  • TrainJob.run_after, TrainJobStatus.epochs and TrainJobStatus.run_after, each with a default, so existing constructor calls still work.

Notes

  • Requires aice-core>=0.3.0,<0.5.

0.0.2

For the engine currently running at https://reco.aiceafrica.com.

Changed (breaking)

  • Renamed from reco-sdk (from reco import RecoClient) to aice-recommendation (from aice_recommendation import RecommendationClient). Errors are renamed to match: RecoError → RecommendationError, AuthError → AuthenticationError.
  • Item.organization_id is now Item.project_id, matching what the server returns.

Fixed

  • create_item, get_item and update_item raised TypeError on every call, because the server returns project_id. The item was still created on the server.
  • Responses are parsed field by field, so new server fields no longer break parsing.
  • Ids are escaped as one path segment, so an id containing /, ? or # can't call a different route.

Added

  • AsyncRecommendationClient, with the same methods as the sync client.
  • track_batch(events) (POST /ingest/batch), with the Event and BatchIngestResult types.
  • recommend(..., persist=True).
  • get_config() / update_config() (ProjectConfig), list_verticals() / get_vertical() (VerticalSummary, Vertical).
  • ValidationError (400/422), ForbiddenError (403) and ConflictError (409). Every error carries status_code and the server's detail, and its message comes from detail.
  • py.typed.

TypeScript: @aiceafrica/recommendation

0.3.0 (unreleased)

Changed BREAKING

  • RecommendationClient takes a vertical option (e.g. "ecommerce"), and every data call needs it. The engine serves users, items, ingest, recommend, train and config under /{vertical}/…. In 0.2.x the only way to reach those routes was to end baseUrl with the vertical, which broke listVerticals / getVertical. To upgrade: take the vertical off baseUrl and pass it as vertical. A baseUrl that still ends with the vertical throws at construction. Without vertical, data calls reject before sending anything.
  • Ids are escaped with encodeURIComponent.

Added

  • deleteItem, anonymiseUser, and trackBatch(events) (up to 10 000 TrackEvents; returns BatchIngestResult).
  • Training: train({ runAfter }), rescheduleJob, cancelJob, and getSchedule / setSchedule / deleteSchedule (TrainSchedule; getSchedule resolves null when there is no schedule).
  • getConfigSchema().
  • TrainJob.runAfter, TrainJobStatus.epochs and TrainJobStatus.runAfter.
  • Exports RecoError, AiceError, APIConnectionError, AiceForbiddenError, InsufficientScopeError and RateLimitError alongside the existing error classes, and VERSION.

Fixed

  • ConflictError was an alias of AiceError, so instanceof ConflictError matched every error. It is now its own class, raised only for a 409, as in the Python SDK.

Changed

  • Needs @aiceafrica/core 0.4.

0.2.2

Not recorded at the time; the version number matches the Python package.

0.2.1

Changed

  • Updated errors.ts's internal import/re-export for @aiceafrica/core 0.3.0's PermissionError → AiceForbiddenError rename. This symbol was never re-exported from this package's own public index.ts (only RecommendationError, AuthenticationError, ValidationError, NotFoundError, ConflictError, ServerError are), so this is not a breaking change for consumers of @aiceafrica/recommendation.

0.2.0 and earlier

Not tracked this changelog starts from the point this package was folded into the aice-sdk monorepo.

On this page