From 1ddeb4631f55f6399b7471eb0d09531fa92f12aa Mon Sep 17 00:00:00 2001 From: Philipp Spiess Date: Fri, 26 May 2023 17:36:15 +0100 Subject: [PATCH] Cody completions: Add docs page (#52447) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Screenshot 2023-05-25 at 13 55 16 --------- Co-authored-by: Erik Seliger Co-authored-by: Alex Isken Co-authored-by: Thorsten Ball --- .metals/metals.log | 33 +++++++++++++++++++++++++++++ .metals/metals.mv.db | Bin 0 -> 45056 bytes doc/cody/completions.md | 45 ++++++++++++++++++++++++++++++++++++++++ doc/sidebar.md | 1 + 4 files changed, 79 insertions(+) create mode 100644 .metals/metals.log create mode 100644 .metals/metals.mv.db create mode 100644 doc/cody/completions.md diff --git a/.metals/metals.log b/.metals/metals.log new file mode 100644 index 00000000000..9311989f73d --- /dev/null +++ b/.metals/metals.log @@ -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 diff --git a/.metals/metals.mv.db b/.metals/metals.mv.db new file mode 100644 index 0000000000000000000000000000000000000000..cf9595aa170785a94fe1045ad07b1f9d539c7b4a GIT binary patch literal 45056 zcmeG_OK>B{bu%DHQKV>FvLwq|?P?aw)h@j-GJnjV9A^i>kc35o6aaE}6(^IK!C=KK zNiYPsB3(J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3l6jT->&$nUN`WFCr9lbrg0zg6M|Bfx3_3=LhD+G2J+yDTUvW)akco@C+M&t&7 z2lNJjQV^zkY^3y&c*v1R{v-YZ2_d~nq{T=%dIJEx0RRGjo$Q4~BKgxB0MG>i^ag-l zh-%j8rW*iWpf>=(eFq;0H>WUjJj@#aGMlr{OfZiIeoaHI4Es6Br_j#c zifLzhEZTlp^BL97PKwt|ZUOjUYFPkUpq2%fMgb{@hTI!|4-rr^M8Su|C1Y593`ax!|hjOVuqV$;PMzr_s&KC&%B>`nPFze zudsNfRX)T@8^6~kVL1!!gVL4O+3vdcN`dFdLtSbAj4c1d;e@ZV41hXj!#M3WSA6w{ z+w=(I4>rC+i@(2F{2>>ASmkdt5~6$1s3+b>I_gO@{sz4PFu0*59C#$fE+f_d$&G^& zy#cT=h!zx$Yx0q~0g&qd$(IzK<|=8b|BoCP-=z9KzGQ;l0N`I@LvH{GMa4fR9Q4QH z1^}%85B2Xrn^1@PzX$&Ro_enOf05|__UQRPoc3c&8i!cY1ls`Q&Q(W&ZBJqb;0?_H zif9`^mgO_t27vSbiSJJQCd160tpDSE0F~|oq_uw{W*l+-_Ov_hbRQsjAK-1WH8C9N z(XEMuT_$`ik#_%WC^x|{1N2=fb-b!kO$+v`(Xs)AN70Onwmll%D_7^MCKK zAn|kPrh76t#K;@f|Ec~DXA@iZ;WpF5Qo?#cPbKL2e~zC2hi +

+Experimental 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. +

+ + +![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 + - shift+cmd+x 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": "" + } +} +``` + +> 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. diff --git a/doc/sidebar.md b/doc/sidebar.md index ec7e78a6221..89794dbdf9c 100644 --- a/doc/sidebar.md +++ b/doc/sidebar.md @@ -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) -