notdiamond
Version:
The official TypeScript library for the Notdiamond API
67 lines • 2.25 kB
JavaScript
;
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Preferences = void 0;
const resource_1 = require("../core/resource.js");
const path_1 = require("../internal/utils/path.js");
class Preferences extends resource_1.APIResource {
/**
* Create a new preference ID for personalized LLM routing.
*
* A preference ID enables personalized routing by tracking your feedback and
* learning your preferences over time. Once created, you can:
*
* 1. Use it in model_select() calls to get personalized routing decisions
* 2. Train a custom router specific to your use case
*
* **Workflow:**
*
* 1. Create a preference ID (this endpoint)
* 2. Use the preference_id in POST /v2/modelRouter/modelSelect requests
* 3. Optionally train a custom router via POST /v2/pzn/trainCustomRouter
*
* **Benefits:**
*
* - Personalized routing for your specific use case
* - Ability to train custom routers on your evaluation data
*
* **Note:** If you don't provide a preference_id in model_select() calls, the
* default router will be used.
*
* @example
* ```ts
* const preference = await client.preferences.create();
* ```
*/
create(body, options) {
return this._client.post('/v2/preferences/userPreferenceCreate', { body, ...options });
}
/**
* Update User Preference
*
* @example
* ```ts
* const preference = await client.preferences.update({
* preference_id: 'preference_id',
* });
* ```
*/
update(body, options) {
return this._client.put('/v2/preferences/userPreferenceUpdate', { body, ...options });
}
/**
* Delete User Preference
*
* @example
* ```ts
* const preference = await client.preferences.delete(
* 'preference_id',
* );
* ```
*/
delete(preferenceID, options) {
return this._client.delete((0, path_1.path) `/v2/preferences/userPreferenceDelete/${preferenceID}`, options);
}
}
exports.Preferences = Preferences;
//# sourceMappingURL=preferences.js.map