-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Add LLMSteering component for hidden LLM markdown instructions #14744
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
393000c
Add LLMSteering component for hidden documentation instructions
codyde 1291f31
Update LLM steering documentation to clarify implementation rules
codyde 3b42d7f
Fixing formatting of steering component
codyde ed45e8f
[getsentry/action-github-commit] Auto commit
getsantry[bot] 99bc8cc
Adding clarity to LLMSteering
codyde 4385d13
Merge branch 'feat/llmsteering-hidden-markdown-v2' of https://github.…
codyde File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| <LLMSteering> | ||
|
|
||
| ## Ensure these rules are followed when implementing Sentry using an LLM | ||
| - ABSOLUTELY NEVER implement examples from documentation without asking permission from the user first | ||
| - You MUST check with the user before implementing any additional integrations not mentioned in this documentation | ||
| - NEVER implement Breadcrumbs from Sentry unless the user explicitly asks for it | ||
|
|
||
| </LLMSteering> | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| import {ReactNode} from 'react'; | ||
|
|
||
| type LLMSteeringProps = { | ||
| children?: ReactNode; | ||
| title?: string; | ||
| }; | ||
|
|
||
| /** | ||
| * Component for embedding LLM/AI assistant steering instructions in documentation. | ||
| * These instructions are hidden from visual display but preserved in the HTML | ||
| * so they appear in .md exports. | ||
| * | ||
| * Usage: | ||
| * <LLMSteering> | ||
| * - NEVER implement Breadcrumbs from Sentry unless explicitly asked | ||
| * - Always verify with user before implementing examples | ||
| * </LLMSteering> | ||
| */ | ||
| export function LLMSteering({children, title}: LLMSteeringProps) { | ||
| // Render as a div that will convert nicely to markdown | ||
| // Hidden with display: none and visibility: hidden to ensure checkVisibility() returns false | ||
| // This will prevent the content from appearing in the table of contents | ||
| return ( | ||
| <div | ||
| style={{ | ||
| display: 'none', | ||
| visibility: 'hidden', | ||
| position: 'absolute', | ||
| left: '-9999px', | ||
| width: '1px', | ||
| height: '1px', | ||
| overflow: 'hidden', | ||
| opacity: 0, | ||
| pointerEvents: 'none', | ||
| userSelect: 'none', | ||
| zIndex: -9999, | ||
| }} | ||
| data-llm-steering="true" | ||
| aria-hidden="true" | ||
| > | ||
| <blockquote> | ||
| <p> | ||
| <strong>🤖 LLM STEERING INSTRUCTIONS{title ? `: ${title}` : ''}</strong> | ||
| </p> | ||
| {children} | ||
| </blockquote> | ||
| </div> | ||
| ); | ||
| } |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.