Skip to content

Commit 57d1fef

Browse files
authored
fix (#67)
1 parent 5b94915 commit 57d1fef

File tree

1 file changed

+14
-13
lines changed
  • src/api/tools/repoHandlers/threejs

1 file changed

+14
-13
lines changed

src/api/tools/repoHandlers/threejs/utils.ts

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -192,25 +192,18 @@ export async function getReferenceDocsContent({
192192
}),
193193
);
194194

195-
const content = await fetchThreeJsUrlsAsMarkdown(urlsToFetch);
196-
197-
return {
198-
filesUsed: urlsToFetch.map(({ url }) => url),
199-
content: [
200-
{
201-
type: "text" as const,
202-
text: content,
203-
},
204-
],
205-
};
195+
return await fetchThreeJsUrlsAsMarkdown(urlsToFetch);
206196
}
207197

208198
/**
209199
* A specific tool for fetching links inside threejs documentation, since the urls are not standard
210200
*/
211201
export async function fetchThreeJsUrlsAsMarkdown(
212202
urlsToFetch: { documentName?: string; url: string }[],
213-
) {
203+
): Promise<{
204+
filesUsed: string[];
205+
content: { type: "text"; text: string }[];
206+
}> {
214207
// get the html content of each page
215208
const htmlContent = await Promise.all(
216209
urlsToFetch.map(async ({ documentName, url }) => {
@@ -267,5 +260,13 @@ export async function fetchThreeJsUrlsAsMarkdown(
267260
`;
268261
}, "");
269262

270-
return content;
263+
return {
264+
filesUsed: urlsToFetch.map(({ url }) => url),
265+
content: [
266+
{
267+
type: "text" as const,
268+
text: content,
269+
},
270+
],
271+
};
271272
}

0 commit comments

Comments
 (0)