Add llms.txt adapter#58
Open
jstar0 wants to merge 1 commit into
Open
Conversation
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
Fixes #12.
Adds a dependency-free
llms.txtadapter so direct/llms.txtURLs can expose a site's declared agent-readable sections and links as tools.The adapter parses the common llms.txt shape:
## OptionalsectionsIt also handles
/llms-full.txtfiles that contain full context instead of link lists by returning a boundedget_full_contexttool.Changes
Adds link-list tools:
list_sectionsget_sectionfetch_linkfetch_linkonly fetches declared links. It rejects non-HTTP(S), obvious local/private/link-local/internal targets, checks the final redirected URL, and caps returned response text at 20,000 characters.Registers format adapters in the engine between OpenAPI and crypto/data adapters.
executeTool()now follows the same adapter precedence asresolveTools(), with regression coverage for an OpenAPI/llms.txt detector overlap.Verification
Notes:
llmstxtadapter tests: 8 tests passed.main; the focusedllmstxtadapter coverage passes cleanly.