Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add new inline sql generation section #6642

Merged
merged 8 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion website/docs/docs/cloud/about-cloud/about-dbt-cloud.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dbt Cloud's [flexible plans](https://www.getdbt.com/pricing/) and features make

<Card
title="dbt Cloud IDE"
body="The IDE is the easiest and most efficient way to develop dbt models, allowing you to build, test, run, and version control your dbt projects directly from your browser. Use dbt Copilot, a powerful AI engine that automatically generates documentation, tests, and semantic models."
body="The IDE is the easiest and most efficient way to develop dbt models, allowing you to build, test, run, and version control your dbt projects directly from your browser. Use dbt Copilot, a powerful AI engine that automatically generates inline SQL, documentation, tests, and semantic models."
mirnawong1 marked this conversation as resolved.
Show resolved Hide resolved
link="/docs/cloud/dbt-cloud-ide/develop-in-the-cloud"
icon="dbt-bit"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The dbt Cloud integrated development environment (IDE) is a single web-based int
The dbt Cloud IDE offers several [keyboard shortcuts](/docs/cloud/dbt-cloud-ide/keyboard-shortcuts) and [editing features](/docs/cloud/dbt-cloud-ide/ide-user-interface#editing-features) for faster and efficient development and governance:

- Syntax highlighting for SQL &mdash; Makes it easy to distinguish different parts of your code, reducing syntax errors and enhancing readability.
- AI copilot &mdash; Use [dbt Copilot](/docs/cloud/dbt-copilot), a powerful AI engine that can generate documentation, tests, and semantic models for your dbt SQL models.
- AI copilot &mdash; Use [dbt Copilot](/docs/cloud/dbt-copilot), a powerful AI engine that can [generate inline SQL](/docs/cloud/use-dbt-copilot#generate-inline-sql) using natural language, and [generate documentation](/docs/build/documentation), [tests](/docs/build/data-tests), and [semantic models](/docs/build/semantic-models) for you with the click of a button.
- Auto-completion &mdash; Suggests table names, arguments, and column names as you type, saving time and reducing typos.
- Code [formatting and linting](/docs/cloud/dbt-cloud-ide/lint-format) &mdash; Helps standardize and fix your SQL code effortlessly.
- Navigation tools &mdash; Easily move around your code, jump to specific lines, find and replace text, and navigate between project files.
Expand Down
6 changes: 4 additions & 2 deletions website/docs/docs/cloud/dbt-copilot.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ pagination_prev: null

# About dbt Copilot <Lifecycle status='beta'/>

dbt Copilot is a powerful artificial intelligence (AI) engine that's fully integrated into your dbt Cloud experience and designed to accelerate your analytics workflows. dbt Copilot embeds AI-driven assistance across every stage of the analytics development life cycle (ADLC), empowering data practitioners to deliver data products faster, improve data quality, and enhance data accessibility. With automatic code generation, you can let the AI engine generate the [documentation](/docs/build/documentation), [tests](/docs/build/data-tests), and [semantic models](/docs/build/semantic-models) for you.
dbt Copilot is a powerful artificial intelligence (AI) engine that's fully integrated into your dbt Cloud experience and designed to accelerate your analytics workflows. dbt Copilot embeds AI-driven assistance across every stage of the analytics development life cycle (ADLC), empowering data practitioners to deliver data products faster, improve data quality, and enhance data accessibility.

With automatic code generation, let dbt Copilot [generate inline SQL](/docs/cloud/use-dbt-copilot#generate-inline-sql) using natural language, and [generate documentation](/docs/build/documentation), [tests](/docs/build/data-tests), and [semantic models](/docs/build/semantic-models) for you with the click of a button.

:::tip Beta feature
dbt Copilot is designed to _help_ developers generate documentation, tests, and semantic models in dbt Cloud. It's available in beta, in the dbt Cloud IDE only.
dbt Copilot is designed to _help_ developers generate documentation, tests, and semantic models, as well as [inline SQL](/docs/cloud/use-dbt-copilot#generate-inline-sql) using natural language, in dbt Cloud. It's available in beta, in the dbt Cloud IDE only.

To use dbt Copilot, you must have an active [dbt Cloud Enterprise account](https://www.getdbt.com/pricing) and either agree to use dbt Labs' OpenAI key or provide your own Open AI API key. [Register here](https://docs.google.com/forms/d/e/1FAIpQLScPjRGyrtgfmdY919Pf3kgqI5E95xxPXz-8JoVruw-L9jVtxg/viewform) or reach out to the Account Team if you're interested in joining the private beta.
:::
Expand Down
59 changes: 53 additions & 6 deletions website/docs/docs/cloud/use-dbt-copilot.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,69 @@
---
title: "Use dbt Copilot"
sidebar_label: "Use dbt Copilot"
description: "Use the dbt Copilot AI engine to generate documentation, tests, and semantic models from scratch, giving you the flexibility to modify or fix generated code."
description: "Use dbt Copilot to generate documentation, tests, semantic models, and inline sql code from scratch, giving you the flexibility to modify or fix generated code."
---

# Use dbt Copilot <Lifecycle status='beta'/>

Use dbt Copilot to generate documentation, tests, and semantic models from scratch, giving you the flexibility to modify or fix generated code. To access and use this AI engine:
Use dbt Copilot to generate documentation, tests, semantic models, and inline sql code from scratch, giving you the flexibility to modify or fix generated code.

1. Navigate to the dbt Cloud IDE and select a SQL model file under the **File Explorer**.
This page explains how to use dbt Copilot to:

2. In the **Console** section (under the **File Editor**), click **dbt Copilot** to view the available AI options.
- [Generate resources](#generate-resources) &mdash; Save time by using dbt Copilot’s generation button to generate documentation, tests, and semantic model files during your development.

Check warning on line 13 in website/docs/docs/cloud/use-dbt-copilot.md

View workflow job for this annotation

GitHub Actions / vale

[vale] website/docs/docs/cloud/use-dbt-copilot.md#L13

[custom.UIElements] UI elements like 'Save' should be bold.
Raw output
{"message": "[custom.UIElements] UI elements like 'Save' should be bold.", "location": {"path": "website/docs/docs/cloud/use-dbt-copilot.md", "range": {"start": {"line": 13, "column": 53}}}, "severity": "WARNING"}
- [Generate inline sql code](#generate-inline-sql-code) &mdash; Use natural language prompts to generate SQL code from scratch or to edit existing SQL file by using keyboard shortcuts or highlighting code.

## Generate resources

Generate documentation, tests, and semantic models resources with the click-of-a-button using dbt Copilot, saving you time. To access and use this AI feature:

1. Navigate to the dbt Cloud IDE and select a SQL model file under the **File Explorer**.
2. In the **Console** section (under the **File Editor**), click **dbt Copilot** to view the available AI options.
3. Select the available options to generate the YAML config: **Generate Documentation**, **Generate Tests**, or **Generate Semantic Model**.
- To generate multiple YAML configs for the same model, click each option separately. dbt Copilot intelligently saves the YAML config in the same file.

4. Verify the AI-generated code. You can update or fix the code as needed.

5. Click **Save As**. You should see the file changes under the **Version control** section.

<Lightbox src="/img/docs/dbt-cloud/cloud-ide/dbt-copilot-doc.gif" width="100%" title="Example of using dbt Copilot to generate documentation in the IDE" />

## Generate inline SQL <Lifecycle status='beta'/>

dbt Copilot also allows you to generate SQL code directly within the SQL file in the dbt Cloud IDE, using natural language prompts. This means you can rewrite or add specific portions of the SQL file file without needing to edit the entire file.

Check warning on line 31 in website/docs/docs/cloud/use-dbt-copilot.md

View workflow job for this annotation

GitHub Actions / vale

[vale] website/docs/docs/cloud/use-dbt-copilot.md#L31

[custom.Repitition] 'file' is repeated!
Raw output
{"message": "[custom.Repitition] 'file' is repeated!", "location": {"path": "website/docs/docs/cloud/use-dbt-copilot.md", "range": {"start": {"line": 31, "column": 196}}}, "severity": "WARNING"}
mirnawong1 marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
dbt Copilot also allows you to generate SQL code directly within the SQL file in the dbt Cloud IDE, using natural language prompts. This means you can rewrite or add specific portions of the SQL file file without needing to edit the entire file.
dbt Copilot also allows you to generate SQL code directly within the SQL file in the dbt Cloud IDE, using natural language prompts. This means you can rewrite or add specific portions of the SQL file without needing to edit the entire file.


This intelligent AI tool streamlines SQL development by reducing errors, scaling effortlessly with complexity, and saving valuable time. dbt Copilot's [prompt window](#use-the-prompt-window), accessible by keyboard shortcut, handles repetitive or complex SQL generation effortlessly so you can focus on high-level tasks.

Use Copilot's prompt window for use cases like:

- Writing advanced transformations
- Performing bulk edits efficiently
- Crafting complex patterns like regex

### Use the prompt window

Access dbt Copilot's AI prompt window using the keyboard shortcut Cmd+B (Mac) or Ctrl+B (Windows) to:

#### 1. Generate SQL from scratch

Check warning on line 45 in website/docs/docs/cloud/use-dbt-copilot.md

View workflow job for this annotation

GitHub Actions / vale

[vale] website/docs/docs/cloud/use-dbt-copilot.md#L45

[custom.SentenceCaseHeaders] '1. Generate SQL from scratch' should use sentence-style capitalization. Try '' instead.
Raw output
{"message": "[custom.SentenceCaseHeaders] '1. Generate SQL from scratch' should use sentence-style capitalization. Try '' instead.", "location": {"path": "website/docs/docs/cloud/use-dbt-copilot.md", "range": {"start": {"line": 45, "column": 6}}}, "severity": "WARNING"}
- Use the keyboard shortcuts Cmd+B (Mac) or Ctrl+B (Windows) to generate SQL from scratch.
- Enter your instructions to generate SQL code tailored to your needs using natural language.

<Lightbox src="/img/docs/dbt-cloud/cloud-ide/copilot-sql-generation-prompt.jpg" width="90%" title="dbt Copilot's prompt window accessible by keyboard shortcut Cmd+B (Mac) or Ctrl+B (Windows)" />

#### 2. Edit existing SQL code

Check warning on line 51 in website/docs/docs/cloud/use-dbt-copilot.md

View workflow job for this annotation

GitHub Actions / vale

[vale] website/docs/docs/cloud/use-dbt-copilot.md#L51

[custom.SentenceCaseHeaders] '2. Edit existing SQL code' should use sentence-style capitalization. Try '' instead.
Raw output
{"message": "[custom.SentenceCaseHeaders] '2. Edit existing SQL code' should use sentence-style capitalization. Try '' instead.", "location": {"path": "website/docs/docs/cloud/use-dbt-copilot.md", "range": {"start": {"line": 51, "column": 6}}}, "severity": "WARNING"}

Check warning on line 51 in website/docs/docs/cloud/use-dbt-copilot.md

View workflow job for this annotation

GitHub Actions / vale

[vale] website/docs/docs/cloud/use-dbt-copilot.md#L51

[custom.UIElements] UI elements like 'Edit' should be bold.
Raw output
{"message": "[custom.UIElements] UI elements like 'Edit' should be bold.", "location": {"path": "website/docs/docs/cloud/use-dbt-copilot.md", "range": {"start": {"line": 51, "column": 9}}}, "severity": "WARNING"}
- Highlight a section of SQL code and press Cmd+B (Mac) or Ctrl+B (Windows) to open the prompt window for editing.
- Use this to refine or modify specific code snippets based on your needs.

#### 3. Review changes with the diff view to quickly assess the impact of the changes before making changes
- When a suggestion is generated, Copilot displays a visual "diff" view to help you compare the proposed changes with your existing code:
- **Green**: Means new code that will be added if you accept the suggestion.
- **Red**: Highlights existing code that will be removed or replaced by the suggested changes.

#### 4. Accept or reject suggestions for full control
mirnawong1 marked this conversation as resolved.
Show resolved Hide resolved
- **Accept**: If the generated SQL meets your requirements, click the **Accept** button to apply the changes directly to your `.sql` file directly in the IDE.
- **Reject**: If the suggestion don’t align with your request/prompt, click **Reject** to discard the generated SQL without making changes and start again.

Once you've accepted a suggestion, you can continue to use the prompt window to generate additional SQL code and commit your changes to the branch.

<Lightbox src="/img/docs/dbt-cloud/cloud-ide/copilot-sql-generation.gif" width="100%" title="Edit existing SQL code using dbt Copilot's prompt window accessible by keyboard shortcut Cmd+B (Mac) or Ctrl+B (Windows)" />

Check warning on line 66 in website/docs/docs/cloud/use-dbt-copilot.md

View workflow job for this annotation

GitHub Actions / vale

[vale] website/docs/docs/cloud/use-dbt-copilot.md#L66

[custom.UIElements] UI elements like 'Edit' should be bold.
Raw output
{"message": "[custom.UIElements] UI elements like 'Edit' should be bold.", "location": {"path": "website/docs/docs/cloud/use-dbt-copilot.md", "range": {"start": {"line": 66, "column": 94}}}, "severity": "WARNING"}

### Considerations
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure this is adding much at the moment! do we have this here to give us space for future considerations?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was more to let ppl know that you can't 'troubleshoot it but @drewbanin did say he thinks it can be removed so i can do that! sorry for the confusion!

Currently, dbt Copilot is focused on generating inline SQL code to streamline development. We're exploring ways to expand its capabilities in the future to further enhance and support your workflow
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading