Skip to content
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

make sidebar chat commands match main quick pick #902

Merged
merged 35 commits into from
Sep 3, 2023

Conversation

taras-yemets
Copy link
Contributor

@taras-yemets taras-yemets commented Sep 1, 2023

Next iteration on #631
Follow-up on #798
Design

  1. Adds separators to the sidebar chat command groups.
  2. Adds reset command.
  3. If the input value starts with a known slash command, the corresponding item remains visible in the commands dropdown.
  4. When a user starts typing a known slash command and hits "Enter", the command is autocompleted in the input field. The next time a user hits "Enter" this command is submitted.
Screen.Recording.2023-09-02.at.09.30.10.mov

Test plan

CI passes.
Tested manually (video attached).

@taras-yemets taras-yemets force-pushed the taras-yemets/enhance-sidebar-chat-commands branch from 84d429d to 7f262d6 Compare September 1, 2023 21:24
@taras-yemets taras-yemets force-pushed the taras-yemets/enhance-sidebar-chat-commands branch from 7f262d6 to 69c8c05 Compare September 1, 2023 21:25
@taras-yemets taras-yemets reopened this Sep 1, 2023
@taras-yemets taras-yemets changed the title wip make sidebar chat commands match main quick pick Sep 1, 2023
@taras-yemets taras-yemets requested review from toolmantim, abeatrix and a team September 2, 2023 06:31
@taras-yemets taras-yemets marked this pull request as ready for review September 2, 2023 06:32
Copy link
Contributor

@abeatrix abeatrix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image image Should the /reset command be added to the quick pick menu too, to be consistent? @toolmantim

@toolmantim
Copy link
Contributor

Should the /reset command be added to the quick pick menu too, to be consistent?

@abeatrix no let’s leave that off as it’s more specific to the chat view.

Copy link
Contributor

@toolmantim toolmantim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pushed a few small tweaks. It would be good to add /ask in there too.

@taras-yemets
Copy link
Contributor Author

Pushed a few small tweaks. It would be good to add /ask in there too.

@toolmantim, "/ask" submits a question is a sidebar chat. The user has already chat input focused, they need to type their question and submit. Does having "/ask" command add additional value in this case?

cbart and others added 3 commits September 3, 2023 22:19
Part of https://github.com/sourcegraph/sourcegraph/issues/56182

Here's how to get this running:

1. Azure keys
* https://portal.azure.com > Azure OpenAI > sourcegraph-test-oai > Keys
and Endpoint
   * Copy the key and `export AZURE_API_KEY="<paste the key here>"`
1. `export SRC_ENDPOINT=https://sourcegraph.sourcegraph.com`
1. `export SRC_ACCESS_TOKEN="<s2 access token goes here>"`
1. Run like so: `pnpm run start --label="Beam search"
--output="$HOME/test.results" --provider=azure`
   * single beam search test runs faster than total # test cases
* output file actually allows you to drill into the LLM interaction
details

## Test plan

Manually verified:

### success scenario with Azure OpenAI and

```
➜  e2e git:(cb/s/56182-azure) ✗ pnpm run start --label="Beam search" --output="$HOME/azure.results" --provider=azure

> @sourcegraph/cody-e2e@0.0.1 start /Users/cbart/cody/e2e
> pnpm run --silent build && node dist/e2e "--label=Beam search" "--output=/Users/cbart/azure.results" "--provider=azure"

Run 1 of 1

Testing (1/1): Beam search (github.com/huggingface/transformers)
Incorrect answers (LLM judge): 0/2 (0%)
Incorrect or partial answers (LLM judge): 1/2 (50%)
Missing facts: 5/9 (56%)
Hallucinated entities: 9/9 (100%)

Run 1 of 1 summary:
Incorrect answers (LLM judge): 0/2 (0%)
Incorrect or partial answers (LLM judge): 1/2 (50%)
Missing facts: 5/9 (56%)
Hallucinated entities: 9/9 (100%)
```

### fast fail when not enough env vars provided

```
➜  e2e git:(cb/s/56182-azure) unset AZURE_DEPLOYMENT_ID
➜  e2e git:(cb/s/56182-azure) ✗ pnpm run start --label="Beam search" --output="$HOME/azure.results" --provider=azure

> @sourcegraph/cody-e2e@0.0.1 start /Users/cbart/cody/e2e
> pnpm run --silent build && node dist/e2e "--label=Beam search" "--output=/Users/cbart/azure.results" "--provider=azure"

Missing required environment variables: AZURE_DEPLOYMENT_ID
1. https://portal.azure.com > Azure OpenAI > sourcegraph-test-oai > Keys and Endpoint
2. Go to Model Deployments > Manage Deployments. Find the deployment name and:
   export AZURE_DEPLOYMENT_ID="<paste deployment name here>"
 ELIFECYCLE  Command failed with exit code 1.
```
Base automatically changed from taras-yemets/make-slash-command-required to main September 3, 2023 20:36
@taras-yemets taras-yemets merged commit cfc7f2e into main Sep 3, 2023
6 of 7 checks passed
@taras-yemets taras-yemets deleted the taras-yemets/enhance-sidebar-chat-commands branch September 3, 2023 21:05
@toolmantim
Copy link
Contributor

toolmantim commented Sep 4, 2023

@toolmantim, "/ask" submits a question is a sidebar chat. The user has already chat input focused, they need to type their question and submit. Does having "/ask" command add additional value in this case?

@taras-yemets there's a similar argument in the command quickpick too, in that they can ask a question just by typing and hitting enter.

But the real value is in consistency & muscle memory.

People can get used to mashing the same keys on the keyboard and having the same commands available, whether it's the chat window or the command quickpick. The goal is that people don't have to keep a mental map of what commands are available in each of the places. Even though it does feel a little redundant or repetitive in isolation.

taras-yemets added a commit that referenced this pull request Sep 4, 2023
1. Adds `/ask` command to sidebar chat commands.
2. Refactors `/ask` and `/edit` commands to use variables for
description and slash commands instead of hardcoded strings.

Follow-up on #902
(#902 (comment))



https://github.com/sourcegraph/cody/assets/25318659/e5363ffe-5b89-4970-aff4-eb329e3bd1ff



## Test plan
CI passes. Tested manually (video attached).
<!-- Required. See
https://docs.sourcegraph.com/dev/background-information/testing_principles.
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants