Skip to content

Commit 85f9e22

Browse files
committed
Remove from dataFetcher
1 parent fc3ab02 commit 85f9e22

File tree

3 files changed

+0
-46
lines changed

3 files changed

+0
-46
lines changed

packages/gitbook-v2/src/lib/data/api.ts

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,6 @@ export function createDataFetcher(
169169
getUserById(userId) {
170170
return trace('getUserById', () => getUserById(input, { userId }));
171171
},
172-
173-
streamAIResponse(params) {
174-
return streamAIResponse(input, params);
175-
},
176172
};
177173
}
178174

@@ -657,31 +653,6 @@ const renderIntegrationUi = cache(
657653
}
658654
);
659655

660-
async function* streamAIResponse(
661-
input: DataFetcherInput,
662-
params: Parameters<GitBookDataFetcher['streamAIResponse']>[0]
663-
) {
664-
const api = apiClient(input);
665-
const res = await api.orgs.streamAiResponseInSite(
666-
params.organizationId,
667-
params.siteId,
668-
{
669-
input: params.input,
670-
output: params.output,
671-
model: params.model,
672-
instructions: params.instructions,
673-
previousResponseId: params.previousResponseId,
674-
},
675-
{
676-
...noCacheFetchOptions,
677-
}
678-
);
679-
680-
for await (const event of res) {
681-
yield event;
682-
}
683-
}
684-
685656
/**
686657
* Create a new API client.
687658
*/

packages/gitbook-v2/src/lib/data/types.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -160,17 +160,4 @@ export interface GitBookDataFetcher {
160160
integrationName: string;
161161
request: api.RenderIntegrationUI;
162162
}): Promise<DataFetcherResponse<api.ContentKitRenderOutput>>;
163-
164-
/**
165-
* Stream an AI response.
166-
*/
167-
streamAIResponse(params: {
168-
organizationId: string;
169-
siteId: string;
170-
instructions: string;
171-
previousResponseId?: string;
172-
input: api.AIMessageInput[];
173-
output: api.AIOutputFormat;
174-
model: api.AIModel;
175-
}): AsyncGenerator<api.AIStreamResponse, void, unknown>;
176163
}

packages/gitbook/src/lib/v1.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -306,10 +306,6 @@ function getDataFetcherV1(apiTokenOverride?: string): GitBookDataFetcher {
306306
})
307307
);
308308
},
309-
310-
streamAIResponse() {
311-
throw new Error('Not implemented in v1');
312-
},
313309
};
314310

315311
return dataFetcher;

0 commit comments

Comments
 (0)