-
Notifications
You must be signed in to change notification settings - Fork 268
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
/symf: remove direct anthropic dependency, pass sourcegraph token #1207
Conversation
ebba582
to
7e87b8c
Compare
7e87b8c
to
cda77e9
Compare
@beyang I've been running this branch but when I run the Screen.Recording.2023-09-27.at.13.46.47.mov |
@@ -107,7 +107,7 @@ const register = async ( | |||
disposables.push(vscode.workspace.onDidChangeTextDocument(updateParseTreeOnEdit)) | |||
} | |||
|
|||
const symfRunner = platform.createSymfRunner?.(context, config.experimentalSymfAnthropicKey) | |||
const symfRunner = platform.createSymfRunner?.(context, initialConfig.accessToken) |
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.
Have you looked into the chatClient
available in the scope here?
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.
Oh nevermind you need that in the symf binary 🤦
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.
symf currently issues its own query to transform the user query into a keyword search... I suppose we could move that out of symf
into Cody/agent and then symf could focus solely on keyword search. Perhaps in a future PR.
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.
Got it to work in the third repo i tried, I think if something breaks during index creation it might not recover properly.
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.
Nice!
Previously,
symf
talked directly to the Anthropic API. Now, it goes through a Sourcegraph instance to access the LLM. This PR updates Cody to pass the Sourcegraph auth token tosymf
and removes the old code for setting an Anthropic API token.Test plan
Test locally:
Check out the main branch
Remove any
cody.experimental.symf.anthropicKey
in your settings.Try running
/symf [query]
. You should see an error indicating thatsymf
is unauthorized.Check out this branch and run the extension
In the sidebar, run
/symf [query]
, where query is either a keyword search or a natural language questionsymf
(v0.0.1) is being downloadedYou should see successful search results