Working in Chat

AI Assistant provides a dedicated chat view where you can exchange messages with the LLM on any topic.

../../_images/ai-chat-vscode.png

You can start a new chat session in several ways:

  • Using Start a New Chat Session command.

  • Using Start a New Session from Blueprint command, where you can select any built-in or custom blueprint that targets the chat.

  • Using the built-in blueprint commands starting with DVT AI Blueprint and targeting the chat.

  • Cloning an existing session from the chat view’s Sessions page.

  • Using Run Last Session in Chat command.

The chat view has two pages, one with the actual chat and another one with all the sessions:

  • Sessions page allows you to switch between sessions and to manage previous sessions.

  • Chat page allows you to exchange messages with the LLM. It’s divided in two sections, the messages area with pairs of user requests and LLM replies and the prompt area where you input your requests.

The prompt area allows you to write your requests and has several features.

Highlight:

  • @snippets and #symbols are highlighted so you can easily identify them.

  • Indicates that the actual request will have a different content after the prompt will be expanded. To preview the message before it’s being sent use the Preview Message before Sending button.

Autocomplete:

  • Speeds-up @snippet and #symbol insertion.

  • Automatically appears when needed (e.g. after writing @ or #).

  • Can be triggered using Ctrl+Space.

List of Buttons, Shortcuts and Commands

The view has a toolbar with the following buttons:

Show All Sessions / Show Last Chat Session

  • Go to the list of sessions and back.

Start a New Chat Session

  • Start an empty chat session.

Save Chat Session as Blueprint

  • Create a new blueprint with all the messages from this session.

The prompt has the following buttons:

Send (Ctrl + Enter or Shift + Enter)

  • Send the request to LLM.

Preview Message before Sending

  • Open an editor with the exact request that will be sent to the LLM.

  • @snippets and #symbols are expanded, warnings or errors might pop-up if expansion fails.

The sent User requests have the following buttons:

Save Message as Blueprint

  • Create a new blueprint with this user message.

Save Message as Snippet

  • Create a new snippet with this user message.

View Sent Message

  • Open an editor with the exact request that was sent to the LLM (@snippets and #symbols expanded).

Resend Message

  • Resend the same request with the snippets expanded in the current context (e.g when @selected code is present, using resend after selecting a new code section will send a different request to the LLM).

  • Branches the session into a new version from this message onward.

Edit and Resend Message

  • Edit and resend the message, snippets will be expanded in the current context (e.g when @selected code is present, using edit and resend after selecting a new code section will send a different request to the LLM).

  • Branches the session into a new version from this message onward.

Start a New Editor Session from Message

  • Start a new editor session with this message as a request.

  • Replaces the current editor selection with the reply. When there’s no selection the reply is inserted at cursor position.

  • Force the insert mode using Ctrl+click.

Previous / Next Requests

  • Navigate through session versions branched from this request.

The LLM replies have the following buttons:

Regenerate

  • Regenerate the reply with the same LLM.

  • Branches the session into a new version from this message onward.

Switch Language Model

  • Regenerate the reply with a different LLM.

  • Branches the session into a new version from this message onward.

Previous / Next Reply

  • Navigate through session versions branched from this reply.

Insert at Cursor

  • Insert the code block in the editor at cursor position.

  • Open a compare editor to preview the changes using Ctrl+click.

  • Button appears only on code blocks generated by LLM.

Copy to Clipboard

  • Copy the code block in the clipboard.

  • Button appears only on code blocks generated by LLM.