Skip to content

Commit

Permalink
20298: Remove default action and feature contexts (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
lancegliser authored Jun 12, 2024
1 parent 0bf552a commit a2107c9
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions src/client/wasm/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,6 @@ export class WasmClient extends BaseClient implements ITraineeClient, ISessionCl
name: metadata.name,
persistence: metadata.persistence,
metadata: metadata.metadata,
default_action_features: metadata.default_action_features || [],
default_context_features: metadata.default_context_features || [],
}) as Trainee;
}

Expand Down Expand Up @@ -458,8 +456,6 @@ export class WasmClient extends BaseClient implements ITraineeClient, ISessionCl
const metadata = {
name: props.name,
metadata: props.metadata,
default_context_features: props.default_context_features,
default_action_features: props.default_action_features,
persistence: props.persistence || "allow",
};
await this.execute(traineeId, "set_metadata", { metadata });
Expand Down Expand Up @@ -874,13 +870,11 @@ export class WasmClient extends BaseClient implements ITraineeClient, ISessionCl
* @param request The react request.
*/
private preprocessReactRequest(trainee: Trainee, request: ReactRequest | ReactSeriesRequest): void {
if (request.desired_conviction == null) {
if (request.action_features == null) {
request.action_features = trainee.default_action_features;
}
if (request.context_features == null) {
request.context_features = trainee.default_context_features;
}
if (!trainee) {
throw new Error("trainee is undefined");
}
if (!request) {
throw new Error("request is undefined");
}
}
}

0 comments on commit a2107c9

Please sign in to comment.