docs(ai-sdk): clarify multi-source library selection#2870
Open
barry166 wants to merge 1 commit into
Open
Conversation
Context7 can expose both repository and docs-site sources for the same project, but the AI SDK tool description did not tell agents how to handle that common shape. Add a narrow prompt hint so agents pick the source that fits the user's question and retry the sibling source before declaring documentation missing. Constraint: Issue upstash#2069 notes multi-source libraries are currently offered separately Rejected: Implement source unification | broader product work than the issue-comment workaround Confidence: medium Scope-risk: narrow Directive: Keep this as selection guidance unless Context7 gains first-class multi-source library records Tested: pnpm --filter @upstash/context7-sdk build Tested: pnpm --filter @upstash/context7-tools-ai-sdk typecheck Tested: pnpm --filter @upstash/context7-tools-ai-sdk build Tested: pnpm --filter @upstash/context7-tools-ai-sdk exec vitest run src/index.test.ts -t 'should export RESOLVE_LIBRARY_ID_DESCRIPTION' Tested: pnpm --filter @upstash/context7-tools-ai-sdk exec prettier --check src/prompts/system.ts src/index.test.ts Tested: git diff --check Not-tested: Full tools-ai-sdk test suite requires AWS_REGION/AWS_BEARER_TOKEN_BEDROCK for Bedrock-backed tests Related: upstash#2069
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Related to #2069.
Testing
corepack pnpm --filter @upstash/context7-sdk buildcorepack pnpm --filter @upstash/context7-tools-ai-sdk typecheckcorepack pnpm --filter @upstash/context7-tools-ai-sdk buildcorepack pnpm --filter @upstash/context7-tools-ai-sdk exec vitest run src/index.test.ts -t "should export RESOLVE_LIBRARY_ID_DESCRIPTION"corepack pnpm --filter @upstash/context7-tools-ai-sdk exec prettier --check src/prompts/system.ts src/index.test.tsgit diff --checkNotes
AI-assisted: yes. I manually reviewed the diff and test output before opening this PR.
Full
corepack pnpm --filter @upstash/context7-tools-ai-sdk testwas not run to completion because the existing Bedrock-backed tests requireAWS_REGION/AWS_BEARER_TOKEN_BEDROCKin the local environment. The targeted non-Bedrock regression test above passed.