Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/tools-ai-sdk/src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
});
});
});
2 changes: 2 additions & 0 deletions packages/tools-ai-sdk/src/prompts/system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down