Cody completions: Add docs page (#52447)

Shipping a simple docs page about completions with some guide on how to
enable them.

If this needs to include some marketing specific language, please let me
know 😅

## Test plan

Docs page, view rendered here:
https://github.com/sourcegraph/sourcegraph/pull/52447/files?short_path=32b8c0b#diff-32b8c0b3a5643a0a3039005e355f016e2f3436afb77f4b062eb48c91721c00d5

<img width="1534" alt="Screenshot 2023-05-25 at 13 55 16"
src="https://github.com/sourcegraph/sourcegraph/assets/458591/91ab793f-2bc6-4eaf-b1db-a0846bc2b129">



<!-- All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles
-->

---------

Co-authored-by: Erik Seliger <erikseliger@me.com>
Co-authored-by: Alex Isken <alex.isken@sourcegraph.com>
Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
This commit is contained in:
Philipp Spiess 2023-05-26 17:36:15 +01:00 committed by GitHub
parent f5cd160b3c
commit 1ddeb4631f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 79 additions and 0 deletions

33
.metals/metals.log Normal file
View File

@ -0,0 +1,33 @@
2023.05.26 14:31:06 INFO Started: Metals version 0.11.12 in workspace '/Users/philipp/dev/sourcegraph' for client Visual Studio Code 1.78.2.
May 26, 2023 2:31:06 PM org.flywaydb.core.internal.license.VersionPrinter printVersionOnly
INFO: Flyway Community Edition 9.16.3 by Redgate
May 26, 2023 2:31:06 PM org.flywaydb.core.internal.license.VersionPrinter printVersion
INFO: See release notes here: https://rd.gt/416ObMi
May 26, 2023 2:31:06 PM org.flywaydb.core.internal.license.VersionPrinter printVersion
INFO:
May 26, 2023 2:31:06 PM org.flywaydb.core.internal.database.base.BaseDatabaseType createDatabase
INFO: Database: jdbc:h2:file:/Users/philipp/dev/sourcegraph/.metals/metals (H2 2.1)
May 26, 2023 2:31:06 PM org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory allAppliedMigrations
INFO: Schema history table "PUBLIC"."flyway_schema_history" does not exist yet
May 26, 2023 2:31:06 PM org.flywaydb.core.internal.command.DbValidate validate
INFO: Successfully validated 4 migrations (execution time 00:00.006s)
May 26, 2023 2:31:06 PM org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory create
INFO: Creating Schema History table "PUBLIC"."flyway_schema_history" ...
May 26, 2023 2:31:06 PM org.flywaydb.core.internal.command.DbMigrate migrateGroup
INFO: Current version of schema "PUBLIC": << Empty Schema >>
May 26, 2023 2:31:06 PM org.flywaydb.core.internal.command.DbMigrate doMigrateGroup
INFO: Migrating schema "PUBLIC" to version "1 - Create tables"
May 26, 2023 2:31:06 PM org.flywaydb.core.internal.command.DbMigrate doMigrateGroup
INFO: Migrating schema "PUBLIC" to version "2 - Server discovery"
May 26, 2023 2:31:06 PM org.flywaydb.core.internal.command.DbMigrate doMigrateGroup
INFO: Migrating schema "PUBLIC" to version "3 - Jar symbols"
May 26, 2023 2:31:06 PM org.flywaydb.core.internal.command.DbMigrate doMigrateGroup
INFO: Migrating schema "PUBLIC" to version "4 - Fingerprints"
May 26, 2023 2:31:06 PM org.flywaydb.core.internal.command.DbMigrate logSummary
INFO: Successfully applied 4 migrations to schema "PUBLIC", now at version v4 (execution time 00:00.024s)
2023.05.26 14:31:06 INFO time: initialize in 0.3s
2023.05.26 14:31:07 WARN Build server is not auto-connectable.
2023.05.26 14:31:07 WARN the build tool Bazel is not supported by Metals, please open an issue if you would like to contribute to improve the situation.
2023.05.26 14:47:27 INFO Shutting down server
2023.05.26 14:47:27 INFO shutting down Metals
2023.05.26 14:47:27 INFO Exiting server

BIN
.metals/metals.mv.db Normal file

Binary file not shown.

45
doc/cody/completions.md Normal file
View File

@ -0,0 +1,45 @@
# Cody completions
<aside class="experimental">
<p>
<span class="badge badge-experimental">Experimental</span> This feature is experimental and might change or be removed in the future. We've released it as an experimental feature to provide a preview of functionality we're working on.
</p>
</aside>
![Example of Cody completions. You see a code snippet starting with async function getWeather(city: string) { and Cody response with a multi-line suggestion using a public weather API to return the current weather ](https://storage.googleapis.com/sourcegraph-assets/cody_completions.png)
## What are Cody completions?
Cody provides real-time code completions as you're typing. As you start coding, or after you type a comment, Cody will look at the context around your open files and file history to predict what you're trying to implement and provide completions. It's autocomplete powered by Cody!
## Enabling Cody completions
While in experimental state, Cody completions need to be enabled manually. To do that:
1. Make sure your [Cody AI by Sourcegraph](https://marketplace.visualstudio.com/items?itemName=sourcegraph.cody-ai) extension is on the latest version
- <kbd>shift</kbd>+<kbd>cmd</kbd>+<kbd>x</kbd> to see all extensions, select Cody, confirm the version
1. Go to the Cody Extension Settings and enable completions
- Click to check the box for: `Cody > Experimental Suggestions`
1. Finally, restart or reload VS Code and test it out!
### Configuring on Sourcegraph Enterprise
Please follow the steps in [Enabling Cody on Sourcegraph Enterprise](explanations/enabling_cody_enterprise.md#enabling-cody-on-sourcegraph-enterprise) to enable Cody on Sourcegraph Enterprise.
You have to configure the model used for Cody completions via the `completionModel` option inside the `completions` site config.
```json
{
// [...]
"completions": {
"enabled": true,
"provider": "anthropic",
"completionModel": "claude-instant-v1.0",
"accessToken": "<key>"
}
}
```
> NOTE: Self-hosted customers need to update to a minimum of version 5.0.4 to use completions.
> NOTE: Cody completions currently only work with Claude Instant or our LLMProxy configured with Claude Instant. Support for other models will be coming later.

View File

@ -75,6 +75,7 @@ Keep it as a single list with at most 2 levels. (Anything else may not render co
- [Quickstart](cody/quickstart.md)
- [Explanations](cody/explanations/index.md)
- [FAQ](cody/faq.md)
- [Completions (experimental)](cody/completions.md)
- [App (beta)](app/index.md)
- [Own (experimental)](own/index.md)
- <br/>