Skip to content

Commit 12e6d5b

Browse files
authored
Merge pull request #181 from Predicate-Labs/rebrand_params
Canonical predicate* params
2 parents 7b4a359 + 88fb255 commit 12e6d5b

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

src/backends/sentience-context.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ export interface SentienceContextState {
5151
* Options for SentienceContext initialization.
5252
*/
5353
export interface SentienceContextOptions {
54-
/** Sentience API key for gateway mode */
54+
/** Canonical API key for gateway mode */
55+
predicateApiKey?: string;
56+
/** Backward-compatible API key alias */
5557
sentienceApiKey?: string;
5658
/** Force API vs extension mode (auto-detected if undefined) */
5759
useApi?: boolean;
@@ -121,7 +123,7 @@ export class SentienceContext {
121123
private _selector: Required<TopElementSelector>;
122124

123125
constructor(options: SentienceContextOptions = {}) {
124-
this._apiKey = options.sentienceApiKey;
126+
this._apiKey = options.predicateApiKey ?? options.sentienceApiKey;
125127
this._useApi = options.useApi;
126128
this._maxElements = options.maxElements ?? 60;
127129
this._showOverlay = options.showOverlay ?? false;
@@ -165,7 +167,7 @@ export class SentienceContext {
165167

166168
// Set API options
167169
if (this._apiKey) {
168-
snapshotOptions.sentienceApiKey = this._apiKey;
170+
snapshotOptions.predicateApiKey = this._apiKey;
169171
}
170172
if (this._useApi !== undefined) {
171173
snapshotOptions.useApi = this._useApi;

src/backends/snapshot.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,9 @@ export interface SnapshotOptions {
106106
useApi?: boolean;
107107
/** Gateway snapshot timeout (milliseconds) */
108108
gatewayTimeoutMs?: number;
109-
/** API key for server-side processing */
109+
/** Canonical API key for server-side processing */
110+
predicateApiKey?: string;
111+
/** Backward-compatible API key alias */
110112
sentienceApiKey?: string;
111113
/** Goal/task description for ordinal support and gateway reranking */
112114
goal?: string;

tests/backends/sentience-context.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ describe('SentienceContext', () => {
7575

7676
it('should use custom values', () => {
7777
const ctx = new SentienceContext({
78-
sentienceApiKey: 'test-key',
78+
predicateApiKey: 'test-key',
7979
maxElements: 100,
8080
showOverlay: true,
8181
topElementSelector: {

0 commit comments

Comments
 (0)