Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add feature flag to control query assistant like features #219

Merged
Merged
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
3 changes: 3 additions & 0 deletions common/types/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ export const configSchema = schema.object({
incontextInsight: schema.object({
enabled: schema.boolean({ defaultValue: true }),
}),
next: schema.object({
enabled: schema.boolean({ defaultValue: false }),
}),
});

export type ConfigSchema = TypeOf<typeof configSchema>;
1 change: 1 addition & 0 deletions public/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ export class AssistantPlugin
actionExecutors[actionType] = execute;
},
chatEnabled: () => this.config.chat.enabled,
nextEnabled: () => this.config.next.enabled,
assistantActions,
registerIncontextInsight: this.incontextInsightRegistry.register.bind(
this.incontextInsightRegistry
Expand Down
4 changes: 4 additions & 0 deletions public/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ export interface AssistantSetup {
* Returns true if chat UI is enabled.
*/
chatEnabled: () => boolean;
/**
* Returns true if contextual assistant is enabled.
*/
nextEnabled: () => boolean;
assistantActions: Omit<AssistantActions, 'executeAction'>;
registerIncontextInsight: IncontextInsightRegistry['register'];
renderIncontextInsight: (component: React.ReactNode) => React.ReactNode;
Expand Down
1 change: 1 addition & 0 deletions server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const config: PluginConfigDescriptor<ConfigSchema> = {
exposeToBrowser: {
chat: true,
incontextInsight: true,
next: true,
},
schema: configSchema,
};
Expand Down
Loading