Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/commands/disengage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Add a new command to reset the authorized engagement context
class DisengageCommand {
execute(input) {
const model = this.getModel();
if (model instanceof Fable5) {
model.setAuthorizedEngagement(false);
}
}
}
9 changes: 9 additions & 0 deletions src/commands/engage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Add a new command to set the authorized engagement context
class EngageCommand {
execute(input) {
const model = this.getModel();
if (model instanceof Fable5) {
model.setAuthorizedEngagement(true);
}
}
}
3 changes: 3 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Register the new plugin
const authorizedEngagementPlugin = new AuthorizedEngagementPlugin();
this.plugins.register(authorizedEngagementPlugin);
38 changes: 38 additions & 0 deletions src/models/fable5.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// Add a new property to store the authorized engagement context
class Fable5 {
constructor() {
this.authorizedEngagement = false;
}

// ...

// Update the safety classifier to check for authorized engagement context
safetyClassifier(input) {
if (this.authorizedEngagement) {
// If authorized engagement context is set, do not auto-switch to Opus
return false;
}
// Otherwise, perform the regular safety classification
// ...
}

// Add a new method to set the authorized engagement context
setAuthorizedEngagement(context) {
this.authorizedEngagement = context;
}
}

// Update the model selection logic to respect the authorized engagement context
class ModelSelector {
// ...

selectModel(input) {
const currentModel = this.getCurrentModel();
if (currentModel instanceof Fable5 && currentModel.authorizedEngagement) {
// If Fable 5 is the current model and authorized engagement context is set, do not switch to Opus
return currentModel;
}
// Otherwise, perform the regular model selection logic
// ...
}
}
16 changes: 16 additions & 0 deletions src/plugins/authorizedEngagement.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Add a new plugin to provide the authorized engagement context
class AuthorizedEngagementPlugin {
constructor() {
this.authorizedEngagement = false;
}

// ...

setAuthorizedEngagement(context) {
this.authorizedEngagement = context;
}

getAuthorizedEngagement() {
return this.authorizedEngagement;
}
}