Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/best-practices/snowflake/_category_.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
label: Snowflake
position: 1
link:
type: generated-index
title: Snowflake
description: Here we present some guidance for Snowflake including setting up a scalable security model amd managing time-travel while meeting GDPR requirements.


2 changes: 1 addition & 1 deletion docs/best-practices/vscode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
title: VS Code
sidebar_position: 5
---
# VS Cod Best Practices and Tips
# VS Code Best Practices and Tips
131 changes: 127 additions & 4 deletions docs/how-tos/vscode/datacoves-copilot/v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,132 @@ sidebar_position: 2

This section describes how to configure and use Datacoves Copilot v1.

Datacoves Copilot v1 supports ChatGPT and Azure Open AI LLMs, Datacoves v4+ includes Datacoves Copilot 2.0 which enhances the experience and supports many more LLM providers.
Datacoves Copilot v1 supports ChatGPT and Azure Open AI LLMs. Datacoves v4+ includes Datacoves Copilot 2.0 which enhances the experience and supports many more LLM providers.

# How Tos
## How Tos

- [LLM Config](./v1-llm-config.md)
- [Working with an LLM in Datacoves](./v1-llm.mdx)
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

<Tabs defaultValue="config" values={[
{label: 'Config', value: 'config'},
{label: 'Usage', value: 'usage'},
]}>

<TabItem value="config">

## Configure your LLM for Datacoves Copilot v1

:::note Datacoves Copilot v1 only support the 4o model gpt model.
:::
### Step 1: Create a Datacoves Secret

Creating a [Datacoves Secret](/docs/how-tos/datacoves/how_to_secrets.md) requires some key fields to be filled out:

- **Name:** The secret must be named `datacoves-copilot-llm-api`
- **Description:** Provide a simple description such as: `Open AI config`
- **Format:** Select `Raw JSON`
- **Value**: The value will vary based on the LLM you are utilizing.
- **Open AI:** You only need your API key. Head to [Open AI](https://platform.openai.com/api-keys) to create your key. `{"OPENAI_API_KEY": "Your key here"}`
- **Azure Open AI:** This requires two credentials. Head to [ai.azure.com](https://ai.azure.com) to find your credentials under the [Deployments](https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/working-with-models?tabs=powershell#model-deployment-upgrade-configuration) tab. `{"AZURE_OPENAI_ENDPOINT": "Your endpoint here", "AZURE_OPENAI_API_KEY" : "Your key here"}`
- **Scope:** Select the desired scope, either `Project` or `Environment`.
- **Project/Environment:** Select the `Project` or `Environment` that will access this LLM.

Lastly, be sure to toggle on the `Share with developers` option so that users with developer access will be able to use the LLM.
![Share with Devs](assets/llm_share_with_devs.png)

### Example Secret

![Example ](assets/llm_example.png)


</TabItem>

<TabItem value="usage">

## Working with an LLM in Datacoves Copilot v1

Once you have configured your LLM, working with the AI chat is a breeze!

## Pre-configured presets

While there are many use cases for AI in the development workflow there are a couple of tasks that come up regularly. To improve the user experience, we have created some presets that provide the LLM with specific instructions to get the best result. Use these or configure your own custom presets.

Current out of the box presents include:

- **Document dbt model:** Will provide descriptions for yml file you have open and provided as context.
- **Explain dbt model:** Will explain a dbt model file you have open and provided as context.
- **Explain dbt macro:** Will explain a dbt macro file you have open and provided as context.
- **Add descriptions to CSV:** Will provide descriptions for CSV files you have open and provided as context.

## How to use the Chat/Presets

### Extension UI/UX

To use your LLM head to the Datacoves Power User extension and open up `Copilot`.

<div style={{ width: "250px" }}>
![LLM Menu](./assets/llm_menu.png)
</div>

### Provide files for context

The most important thing to remember is providing context to the LLM. In order to do this simply open up the file you wish to work with.

![llm file open](assets/llm_file_open.png)

### Send specific lines of code for context

Highlight the lines of code you wish to send.

![context lines](assets/llm_line_context.png)

### Don't provide context

In the case that you don't want to send an open file for context you can select the icon below.

![llm context](assets/llm_context.gif)

## Using LLM code

Datacoves Copilot makes copying AI generated code simple with 3 options.

![Code Options](assets/llm_code_options.png)

### Replace

Replace the entire code file with the LLM code.

![llm Replace](assets/llm_replace.gif)

### Insert

Insert LLM code into your file.

![llm Insert](assets/llm_insert.gif)

### Copy

Traditional copy and paste.

![llm Copy](assets/llm_copy.gif)

### New Chat

To start a new chat click on the `New Chat` button.

![New Chat](assets/llm_new_chat.png)

## Prefer a Video?
<div style={{ position: "relative", paddingBottom: "56.25%", height: 0 }}>
<iframe
src="https://www.loom.com/embed/b6e987152c114c3c8d44dc7712aa3e22?sid=d8847855-38cc-4a84-90b3-6be7e660f8b5"
frameBorder="0"
allowFullScreen
style={{ position: "absolute", top: 0, left: 0, width: "100%", height: "100%" }}
/>
</div>

</TabItem>

</Tabs>
Loading