diff --git a/packages/tools-ai-sdk/src/index.test.ts b/packages/tools-ai-sdk/src/index.test.ts index 6302f54f3..dc916a2b7 100644 --- a/packages/tools-ai-sdk/src/index.test.ts +++ b/packages/tools-ai-sdk/src/index.test.ts @@ -223,6 +223,7 @@ describe("@upstash/context7-tools-ai-sdk", () => { expect(RESOLVE_LIBRARY_ID_DESCRIPTION).toBeDefined(); expect(typeof RESOLVE_LIBRARY_ID_DESCRIPTION).toBe("string"); expect(RESOLVE_LIBRARY_ID_DESCRIPTION).toContain("library"); + expect(RESOLVE_LIBRARY_ID_DESCRIPTION).toContain("docs site"); }); }); }); diff --git a/packages/tools-ai-sdk/src/prompts/system.ts b/packages/tools-ai-sdk/src/prompts/system.ts index bd0458c54..e9e245a1e 100644 --- a/packages/tools-ai-sdk/src/prompts/system.ts +++ b/packages/tools-ai-sdk/src/prompts/system.ts @@ -61,6 +61,8 @@ Selection Process: - Documentation coverage (prioritize libraries with higher Code Snippet counts) - Source reputation (consider libraries with High or Medium reputation more authoritative) - Benchmark Score: Quality indicator (100 is the highest score) +- Source type fit: some projects have separate repo and docs site entries; choose the source that best matches the user's question +- If one source lacks the needed API reference, examples, or guide content, try the other available source before concluding the docs are missing Response Format: - Return the selected library ID in a clearly marked section