-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathassistant-getting-started.qmd
More file actions
272 lines (175 loc) · 11.5 KB
/
assistant-getting-started.qmd
File metadata and controls
272 lines (175 loc) · 11.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
---
title: "Getting Started"
description: "Configure and customize Positron Assistant by connecting it to your preferred AI model provider, such as Anthropic or GitHub Copilot. Choose the exact LLM provider that fits your workflow and security needs."
listing:
- id: chat-features
type: custom
template: templates/welcome-card.ejs
contents:
- title: "Chat pane"
description: "A dedicated AI chat pane for coding, troubleshooting, and planning."
icon: "bi-chat-text"
link: "assistant-chat.qmd#chat-pane"
- title: "Inline chat"
description: "In-context AI assistance within your code Editor, Notebook, or Terminal."
icon: "bi-chat-square-text"
link: "assistant-chat.qmd#inline-chat"
- title: "Code completions"
description: "Receive code suggestions directly in your Editor or Notebook."
icon: "bi-cursor-text"
link: "assistant-completions.qmd"
---
Positron Assistant supports the following language model providers:
| Provider | Chat | Code Completions | Authentication |
|------|:--:|:---:|---------|
| Anthropic | {{< fa check >}} | | API Key |
| GitHub Copilot (Preview) | {{< fa check >}} | {{< fa check >}} | GitHub OAuth |
| Amazon Bedrock (Preview) | {{< fa check >}} | | AWS CLI or Posit Workbench Managed Credentials |
| Snowflake Cortex (Preview) | {{< fa check >}} | | API Key or Posit Workbench Managed Credentials |
| OpenAI (Preview) | {{< fa check >}} | | API Key |
| Custom Provider (Experimental) | {{< fa check >}} | | API Key |
We're actively expanding provider support and welcome your [feedback](https://github.com/posit-dev/positron/discussions) and [issue reports](https://github.com/posit-dev/positron/issues/new/choose)!
Please ensure you consult your provider's privacy policy for information on the data they collect and how it is used. For reference links, see the [Positron Assistant Provider Information](assistant-provider-info.qmd) guide.
For information on what information is collected by Posit, review [Posit's Data Privacy](privacy.qmd).
## Step 1: Enable Positron Assistant
1. Enable the setting [`positron.assistant.enable`](positron://settings/positron.assistant.enable).
1. Restart Positron or run the _Developer: Reload Window_ command in the Command Palette.
## Step 2: Configure language model providers
::: {.panel-tabset group="providers"}
## Anthropic
::: {.callout-important}
Positron Assistant requires a **Claude Console account with API access**. See Anthropic's [Claude API and Console](https://support.claude.com/en/collections/5370014-claude-api-and-console) documentation for more information.
Positron Assistant **does not** support logging into Anthropic with the Claude Pro Plan, Max Plan, or other Claude subscription plans.
<details>
<summary>How to get an Anthropic API key</summary>
To use Anthropic's Claude models in Positron Assistant, you need to bring your own API key (BYOK). To obtain an API key from Anthropic:
1. Log in to or create an account for Anthropic's [Claude Console](https://platform.claude.com).
1. Navigate to the [API keys](https://platform.claude.com/settings/keys) management page.
1. Click the {{< fa plus >}} **Create Key** button.
1. Fill out any required information and click **Add** to generate your API key.
1. Copy and save the API key to a password manager or another secure location.
</details>
:::
### Add Anthropic as a language model provider
1. Run the command _Positron Assistant: Configure Language Model Providers_
1. Select **Anthropic** as the model provider.
{width=600}
1. Paste your Claude Console API key into the input field and click **Sign in**.
::: {.callout-tip}
Alternatively, set the `ANTHROPIC_API_KEY` environment variable to authenticate with Anthropic in Positron Assistant.
:::
## GitHub Copilot
::: {.callout-important}
Positron Assistant requires a **GitHub account with Copilot enabled**.
<details>
<summary>How to get GitHub Copilot access</summary>
GitHub Copilot is a proprietary tool from GitHub. If you want to use GitHub Copilot, you need a [subscription for GitHub Copilot](https://docs.github.com/en/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot) in your personal GitHub account or to be assigned a seat by an organization with a subscription for GitHub Copilot for Business.
Students and faculty can use GitHub Copilot for free as part of the GitHub Education program. For more information, see the [GitHub Education page](https://education.github.com/).
</details>
:::
### Add GitHub Copilot as a language model provider
1. Run the command _Positron Assistant: Configure Language Model Providers_
1. Select **GitHub Copilot** as the model provider.
{width=600}
1. Click the **Sign in** button to initiate GitHub's OAuth authentication flow.
- Complete the authentication flow in your browser, and return to Positron when finished.
::: {.callout-tip}
If you are using Positron with a [remote SSH](remote-ssh.qmd) session, you will need to authenticate to GitHub on the _remote server_ as well. Follow [along on GitHub](https://github.com/posit-dev/positron/issues/8409) as we make improvements in this area.
:::
## Amazon Bedrock
::: {.callout-important}
To use Amazon Bedrock in Positron Desktop, Positron Assistant requires an **AWS account with Amazon Bedrock access**, and you must be signed in using the AWS CLI.
<details>
<summary>Login with the AWS CLI</summary>
1. [Download and install the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html)
1. [Configure your AWS credentials for the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html)
1. [Login with the AWS CLI](https://docs.aws.amazon.com/signin/latest/userguide/command-line-sign-in.html)
</details>
:::
### Enable Amazon Bedrock as a provider
Amazon Bedrock provider support is currently in **preview** and must be manually enabled.
Run the command _Preferences: Open User Settings (JSON)_ and add the following to your settings file:
```{.json filename="settings.json"}
"positron.assistant.enabledProviders": [
"amazon-bedrock"
]
```
### (Optional) Configure AWS region and profile
By default, Positron Assistant uses the `default` AWS CLI profile and the `us-east-1` region to connect to Amazon Bedrock.
To specify a different AWS CLI profile or region, update the [`positron.assistant.providerVariables.bedrock`](positron://settings/positron.assistant.providerVariables.bedrock) setting.
### Add Amazon Bedrock as a language model provider
1. Run the command _Positron Assistant: Configure Language Model Providers_
1. Select **Amazon Bedrock** as the model provider.
{width=600}
1. Click **Sign in** so Positron Assistant can verify your AWS CLI authentication.
## Snowflake Cortex
::: {.callout-important}
To use Snowflake Cortex in Positron Desktop, Positron Assistant requires a **Snowflake account with Cortex access**, as well as a Snowflake [account identifier](https://docs.snowflake.com/en/user-guide/admin-account-identifier) and [programmatic access token](https://docs.snowflake.com/en/user-guide/programmatic-access-tokens) (PAT).
:::
### Enable Snowflake Cortex as a provider
Snowflake Cortex provider support is currently in **preview** and must be manually enabled.
Run the command _Preferences: Open User Settings (JSON)_ and add the following to your settings file:
```{.json filename="settings.json"}
"positron.assistant.enabledProviders": [
"snowflake-cortex"
]
```
### Add Snowflake Cortex as a language model provider
1. Add your `SNOWFLAKE_ACCOUNT` ID to the [`positron.assistant.providerVariables.snowflake`](positron://settings/positron.assistant.providerVariables.snowflake) setting
1. Run the command _Positron Assistant: Configure Language Model Providers_
1. Select **Snowflake Cortex** as the model provider.
{width=600}
1. Paste your Snowflake Cortex PAT into the API key field, then click **Sign in**.
## OpenAI
### Enable OpenAI as a provider
OpenAI provider support is currently in **preview** and must be manually enabled.
Run the command _Preferences: Open User Settings (JSON)_ and add the following to your settings file:
```{.json filename="settings.json"}
"positron.assistant.enabledProviders": [
"openai-api"
]
```
### Add OpenAI as a language model provider
1. Run the command _Positron Assistant: Configure Language Model Providers_
1. Select **OpenAI** as the model provider.
{width=600}
1. Paste your OpenAI API key into the input field and click **Sign in**.
::: {.callout-tip}
Use the OpenAI provider to connect to a provider that implements the [OpenAI Responses API](https://platform.openai.com/docs/api-reference/responses), by replacing the base URL with your compatible custom endpoint.
:::
<!-- vale Posit.Headings = NO -->
## Custom Provider
<!-- vale Posit.Headings = Yes -->
::: {.callout-important}
Positron Assistant's custom provider support is intended for use with any [OpenAI-compatible](https://ai-sdk.dev/providers/openai-compatible-providers) API endpoint that uses the `/v1/chat/completions` endpoint for chat.
At this time, we don't recommend using a local model as a custom provider. Read more about why [local models are not there (yet)](https://posit.co/blog/local-models-are-not-there-yet/) on Posit's blog.
:::
<!-- vale Posit.Headings = NO -->
### Enable Custom Provider as a provider
<!-- vale Posit.Headings = Yes -->
Custom provider support is currently **experimental** and must be manually enabled.
Run the command _Preferences: Open User Settings (JSON)_ and add the following to your settings file:
```{.json filename="settings.json"}
"positron.assistant.enabledProviders": [
"openai-compatible"
]
```
<!-- vale Posit.Headings = NO -->
### Add Custom Provider as a language model provider
<!-- vale Posit.Headings = Yes -->
1. Run the command _Positron Assistant: Configure Language Model Providers_
1. Select **Custom Provider** as the model provider.
{width=600}
1. Enter your API key and base URL into the input fields and click **Sign in**.
::: {.callout-tip}
Some OpenAI-compatible providers may not implement the `/models` endpoint, which Positron Assistant uses to list available models. If this is the case for your provider, you can manually configure a model listing using the [`positron.assistant.models.custom`](positron://settings/positron.assistant.models.custom) setting.
:::
:::
## Step 3: Use Positron Assistant!
Once you've authenticated with at least one language model provider, you're all set to use Positron Assistant.
1. Click on the chat robot icon in the sidebar, or run the command _Chat: Open Chat_ in the Command Palette to open the chat:
{height=450}
1. Chat with Assistant by typing your question or request in the chat input box at the bottom of the chat pane, then pressing {{< kbd Enter >}} or the {{< fa paper-plane regular >}} send button.
To learn more about Positron Assistant's core features, check out the following guides:
::: {#chat-features}
:::