mirror of
https://github.com/bendtherules/ask262.git
synced 2026-08-18 13:21:55 +00:00
refactor(searchSpecSections): remove content field from result
- Eliminated `content` property from `searchSpecResultSchema` and output mapping. - Updated `toolMetadata` description to reflect that only section references are returned and content must be fetched via `ask262_get_section_content`. - Adjusted TypeScript code accordingly.
This commit is contained in:
@@ -17,7 +17,6 @@ const searchSpecResultSchema = z.object({
|
|||||||
.describe("Vector distance from query (lower = more similar)"),
|
.describe("Vector distance from query (lower = more similar)"),
|
||||||
partIndex: z.number().nullable(),
|
partIndex: z.number().nullable(),
|
||||||
totalParts: z.number().nullable(),
|
totalParts: z.number().nullable(),
|
||||||
content: z.string(),
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const searchSpecOutputSchema = z.object({
|
const searchSpecOutputSchema = z.object({
|
||||||
@@ -31,7 +30,8 @@ const searchSpecOutputSchema = z.object({
|
|||||||
export const toolMetadata = {
|
export const toolMetadata = {
|
||||||
description:
|
description:
|
||||||
"Vector search the ECMAScript specification for sections relevant to a query. " +
|
"Vector search the ECMAScript specification for sections relevant to a query. " +
|
||||||
"Returns an array of sections with sectionId, sectionTitle, score, partIndex, totalParts, and content. " +
|
"Returns an array of section references (sectionId, sectionTitle, vectorDistance, partIndex, totalParts). " +
|
||||||
|
"Use ask262_get_section_content to retrieve the actual content for a section. " +
|
||||||
"partIndex and totalParts indicate which chunk of a multi-part section this is " +
|
"partIndex and totalParts indicate which chunk of a multi-part section this is " +
|
||||||
"(0-indexed, partIndex+1/totalParts), null if single-part.",
|
"(0-indexed, partIndex+1/totalParts), null if single-part.",
|
||||||
args: {
|
args: {
|
||||||
@@ -86,7 +86,6 @@ export function createSearchSpecSectionsTool(
|
|||||||
vectorDistance: Number(r._distance || 0),
|
vectorDistance: Number(r._distance || 0),
|
||||||
partIndex: (r.partindex as number | undefined) ?? null,
|
partIndex: (r.partindex as number | undefined) ?? null,
|
||||||
totalParts: (r.totalparts as number | undefined) ?? null,
|
totalParts: (r.totalparts as number | undefined) ?? null,
|
||||||
content: String(r.text || ""),
|
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user