Skip to content

Commit 1c6ab47

Browse files
committed
Remove Slack conversation ingestion
Remove the Slack conversation ingestion feature and related code. Deletes ingestConversation action and types, removes the ingestion tool and handler branch, strips the conversations:ingest scope from the manifest, and removes the feature-flag helper (isDocsAgentsConversationsEnabled). Update exports and imports accordingly across the Slack integration.
1 parent 3d040b0 commit 1c6ab47

File tree

8 files changed

+3
-258
lines changed

8 files changed

+3
-258
lines changed

integrations/slack/gitbook-manifest.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ script: ./src/index.ts
1919
scopes:
2020
- space:content:read
2121
- space:metadata:read
22-
- conversations:ingest
2322
summary: |
2423
# Overview
2524
With the GitBook Slack integration, your teams have instant access to your documentation, and can get AI-summarized answers about your content.
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
export * from './queryAskAI';
2-
export * from './ingestConversation';
32
export * from './inferUserIntent';
43
export * from './types';

integrations/slack/src/actions/inferUserIntent.ts

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { createOpenAI } from '@ai-sdk/openai';
33
import { z } from 'zod';
44

55
import { queryAskAI } from './queryAskAI';
6-
import { ingestSlackConversation } from './ingestConversation';
76
import type { SlackInstallationConfiguration, SlackRuntimeContext } from '../configuration';
87
import { slackAPI } from '../slack';
98
import { getIntegrationInstallationForTeam } from '../utils';
@@ -98,14 +97,10 @@ You are a Slack assistant designed to help users with their product documentatio
9897
9998
# Tools
10099
- **askAIQuery**: Use when the user is clearly asking a question about their product, features, documentation, or content.
101-
- **ingestConversation**: Use to ingest the current Slack thread so that any feedback or discussion can be used to improve the user's documentation.
102-
- When a user refers to “this feedback,” “this conversation,” or similar phrases without specifying details, infer that they mean the feedback in the current Slack thread.
103-
- Do **not** ask for clarification unless it’s genuinely ambiguous (for example, if the user mentions feedback from another source).
104100
105101
# Rules
106-
- Always pick the tool that best matches the user's intent.
102+
- Always pick the tool that best matches the users intent.
107103
- Be concise and polite when asking for clarification.
108-
- Make reasonable inferences from context — for example, “this feedback” refers to the current thread.
109104
- Base decisions solely on the current message and its immediate context.
110105
`,
111106
},
@@ -189,26 +184,7 @@ function getActionsTools(
189184
},
190185
});
191186

192-
const ingestConversationTool = tool({
193-
description: 'Ingest this Slack conversation thread for improving documentation.',
194-
inputSchema: z.object({}),
195-
execute: async () => {
196-
return ingestSlackConversation({
197-
channelId,
198-
teamId,
199-
threadId: threadTs,
200-
userId,
201-
context: slackRuntimeContext,
202-
conversationToIngest: {
203-
channelId,
204-
messageTs: threadTs,
205-
},
206-
});
207-
},
208-
});
209-
210187
return {
211188
askAIQuery: askAIQueryTool,
212-
ingestConversation: ingestConversationTool,
213189
};
214190
}

integrations/slack/src/actions/ingestConversation.ts

Lines changed: 0 additions & 159 deletions
This file was deleted.

integrations/slack/src/actions/types.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,6 @@ interface ActionBaseParams {
1515
threadId?: string;
1616
}
1717

18-
export interface IngestSlackConversationActionParams extends ActionBaseParams {
19-
/**
20-
* Used when the ingestion originates from a Slack conversation shortcut.
21-
* The target conversation in this case is both the conversation to ingest
22-
* and the one where notifications are sent.
23-
* Identified by the `channelId` and `messageTs` values.
24-
*/
25-
conversationToIngest: {
26-
channelId: string;
27-
messageTs: string;
28-
};
29-
}
30-
3118
export interface AskAIActionParams extends ActionBaseParams {
3219
queryText: string;
3320

integrations/slack/src/handlers/actions.ts

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
import { Logger } from '@gitbook/runtime';
2-
import {
3-
ingestSlackConversation,
4-
IngestSlackConversationActionParams,
5-
queryAskAI,
6-
type AskAIActionParams,
7-
} from '../actions';
2+
import { queryAskAI, type AskAIActionParams } from '../actions';
83
import { SlackRuntimeContext } from '../configuration';
94
import { getActionNameAndType, parseActionPayload } from '../utils';
105

@@ -41,25 +36,6 @@ export const slackActionsHandler = async (request: Request, context: SlackRuntim
4136

4237
return;
4338
}
44-
case 'ingest_conversation': {
45-
const params: IngestSlackConversationActionParams = {
46-
channelId: channel.id,
47-
channelName: channel.name,
48-
responseUrl: response_url,
49-
teamId: team.id,
50-
threadId: message_ts,
51-
userId: user.id,
52-
context,
53-
conversationToIngest: {
54-
channelId: channel.id,
55-
messageTs: message_ts,
56-
},
57-
};
58-
59-
context.waitUntil(ingestSlackConversation(params));
60-
61-
return;
62-
}
6339
default:
6440
logger.debug(`No matching handler for action: ${actionName}`);
6541
}

integrations/slack/src/handlers/handlers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Logger } from '@gitbook/runtime';
22

33
import type { SlashEvent } from './commands';
4-
import { inferUserIntentAndTriggerAction, ingestSlackConversation, queryAskAI } from '../actions';
4+
import { inferUserIntentAndTriggerAction, queryAskAI } from '../actions';
55
import { SlackRuntimeContext } from '../configuration';
66
import { isAllowedToRespond, stripBotName } from '../utils';
77

integrations/slack/src/utils.ts

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -148,36 +148,3 @@ export function isAllowedToRespond(eventPayload: any) {
148148

149149
return !isFromBot && !isExternalChannel;
150150
}
151-
152-
/**
153-
* Check if GitBook Agent conversations ingestion is enabled for the organization.
154-
*
155-
* TODO: Remove when GitBook Agent reached general availability.
156-
*/
157-
export async function isDocsAgentsConversationsEnabled(params: {
158-
organizationId: string;
159-
context: SlackRuntimeContext;
160-
}): Promise<boolean> {
161-
const { organizationId, context } = params;
162-
try {
163-
const response = await fetch(
164-
`https://front.reflag.com/features/enabled?context.company.id=${organizationId}&key=DOCS_AGENTS_CONVERSATIONS`,
165-
{
166-
method: 'GET',
167-
headers: {
168-
Authorization: `Bearer ${context.environment.secrets.REFLAG_SECRET_KEY}`,
169-
'Content-Type': 'application/json',
170-
},
171-
},
172-
);
173-
174-
const json = (await response.json()) as {
175-
features: { DOCS_AGENTS_CONVERSATIONS: { isEnabled: boolean } };
176-
};
177-
const flag = json.features.DOCS_AGENTS_CONVERSATIONS;
178-
179-
return flag.isEnabled;
180-
} catch (e) {
181-
return false;
182-
}
183-
}

0 commit comments

Comments
 (0)