Skip to content

Commit fefc79f

Browse files
committed
Context selection for prompts
1 parent b3578f4 commit fefc79f

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

docs/cody/capabilities/prompts.mdx

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Click the **New prompt** button from the **Prompt Library** page.
4545

4646
There are also a few advanced options that you can configure.
4747

48-
![create-prompt](https://storage.googleapis.com/sourcegraph-assets/Docs/create-prompt-2025-01.png)
48+
![create-prompt](https://storage.googleapis.com/sourcegraph-assets/Docs/create-prompts-0225.jpg)
4949

5050
### Draft prompts
5151

@@ -90,6 +90,24 @@ Once site admins create tags, other users in your organization can assign tags t
9090

9191
You can assign multiple tags to a prompt and group them based on their functionality, category, or any other criteria for your organization. In addition, with tags assigned to prompts, you can filter prompts by tags in the Prompt Library.
9292

93+
## Specific and dynamic context
94+
95+
<Callout type="info">Sourcegraph 6.0 adds Beta support for the `@` mention menu in the prompt library.</Callout>
96+
97+
When writing prompts, you can leverage both specific and dynamic context through the `@` mention system.
98+
99+
![A dropdown appears after typing `@` in the prompt editor.](https://storage.googleapis.com/sourcegraph-assets/Docs/%40-mention-prompts-0225.jpg)
100+
101+
Type `@` to open a dropdown menu that lets you reference specific context like symbols, directories, files, repositories and web URLs.
102+
103+
When selecting a web URL, type out the domain, including the `https://` prefix, for example, https://sourcegraph.com.
104+
105+
For dynamic context that adapts based on what the user is working on, the prompt editor provides special mentions for the current selection, current file, current repository, current directory, and open tabs.
106+
When a user runs a prompt template containing dynamic context mentions, they are automatically resolved to the appropriate specific context based on the user's current workspace state.
107+
To add dynamic context, click on one of the buttons below the prompt editor. We will soon move the buttons into the `@` mention menu as well.
108+
109+
This powerful combination allows prompt authors to create templates that can intelligently access both explicitly defined context and contextually relevant information at runtime.
110+
93111
## Run prompts
94112

95113
You can run prompts via:

0 commit comments

Comments
 (0)