Skip to content

Commit

Permalink
Disable oracle schema by default (#511)
Browse files Browse the repository at this point in the history
Oracle is in conflict with the chat agent. Disable the schema by
default.


Also rename the setting to `schemaDefaultEnabled` to align terminology
  • Loading branch information
curtisman authored Dec 19, 2024
1 parent 4539e6b commit 785f1a3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion ts/packages/agentSdk/src/agentInterface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export type SchemaManifest = {

export type ActionManifest = {
defaultEnabled?: boolean;
translationDefaultEnabled?: boolean;
schemaDefaultEnabled?: boolean;
actionDefaultEnabled?: boolean;
transient?: boolean; // whether the translator is transient, default is false

Expand Down
1 change: 1 addition & 0 deletions ts/packages/agents/oracle/src/oracleManifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"emojiChar": "🌀",
"description": "Agent to produce oracular answers",
"schemaDefaultEnabled": false,
"schema": {
"description": "Oracle which gives mysterious answers",
"schemaFile": "./oracleSchema.ts",
Expand Down
2 changes: 1 addition & 1 deletion ts/packages/dispatcher/src/context/appAgentManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ export class AppAgentManager implements ActionConfigProvider {
"schemas",
name,
useDefault,
config.translationDefaultEnabled,
config.schemaDefaultEnabled,
record.schemas.has(name),
failedSchemas,
);
Expand Down
14 changes: 7 additions & 7 deletions ts/packages/dispatcher/src/translation/agentTranslators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const debugConfig = registerDebug("typeagent:dispatcher:schema:config");
export type ActionConfig = {
emojiChar: string;

translationDefaultEnabled: boolean;
schemaDefaultEnabled: boolean;
actionDefaultEnabled: boolean;
transient: boolean;
schemaName: string;
Expand All @@ -69,14 +69,14 @@ function collectActionConfigs(
schemaName: string,
emojiChar: string,
transient: boolean,
translationDefaultEnabled: boolean,
schemaDefaultEnabled: boolean,
actionDefaultEnabled: boolean,
) {
transient = manifest.transient ?? transient; // inherit from parent if not specified
translationDefaultEnabled =
manifest.translationDefaultEnabled ??
schemaDefaultEnabled =
manifest.schemaDefaultEnabled ??
manifest.defaultEnabled ??
translationDefaultEnabled; // inherit from parent if not specified
schemaDefaultEnabled; // inherit from parent if not specified
actionDefaultEnabled =
manifest.actionDefaultEnabled ??
manifest.defaultEnabled ??
Expand All @@ -89,7 +89,7 @@ function collectActionConfigs(
emojiChar,
...manifest.schema,
transient,
translationDefaultEnabled,
schemaDefaultEnabled,
actionDefaultEnabled,
};
}
Expand All @@ -106,7 +106,7 @@ function collectActionConfigs(
`${schemaName}.${subName}`,
emojiChar,
transient, // propagate default transient
translationDefaultEnabled, // propagate default translationDefaultEnabled
schemaDefaultEnabled, // propagate default schemaDefaultEnabled
actionDefaultEnabled, // propagate default actionDefaultEnabled
);
}
Expand Down

0 comments on commit 785f1a3

Please sign in to comment.