-
Notifications
You must be signed in to change notification settings - Fork 374
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
Pass full filepath in prompt to the LLM. #7472
Conversation
9c116c8
to
ff18990
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I think the test is failing cause of the windows path. There is an helper function that you can use to fix the tests on windows
version: 1, | ||
contextItem: { | ||
type: 'file', | ||
uri: 'file:///foo/bar/file1.go', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uri: 'file:///foo/bar/file1.go', | |
uri: testFileUri('/foo/bar/file1.go'), |
i think this should fix the test on windows
69e2fe4
to
c28c06a
Compare
) | ||
}) | ||
}) | ||
|
||
describe('editorStateFromPromptString', () => { | ||
test('converts to rich mentions', async () => { | ||
const input = ps`What are @${PromptString.fromDisplayPath( | ||
URI.file('foo.go') | ||
)}:3-5 and @${PromptString.fromDisplayPath(URI.file('bar.go'))} about?` | ||
testFileUri('foo.go') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
testFileUri('foo.go') | |
displayPath(testFileUri('/foo.go')) |
if it's fromDisplayPath?
268ea6b
to
4a7be80
Compare
closes: https://linear.app/sourcegraph/issue/CODY-5393/bug-fix-send-the-file-path-to-the-model-for-at-mentions
This PR updates the get text from editor state logic to include the full file display path and not just the file basename.
The text is sent to the LLM as the human message text.
Test plan
unit tests added.
mention a file and debug & test if the full file display path is included in the prompt.