Copilot

Snoweaver Copilot provides comprehensive assistance for generating and debugging Jinja and Python code within Jobs, Macro Libraries, and Functions. It offers intelligent code suggestions, helps identify and fix errors, and can answer questions to expedite the development process.

For instructions on how to enable Snoweaver Copilot, please see Global Configuration.

Using Copilot

Once enabled, Copilot is accessible within the following components of the project console:

  • All Jinja components

  • The Python editor for function definitions

  • Web Request Preview

To activate Copilot, click the Open Copilot button.

System prompt

By default, Copilot is initialized with a system prompt containing essential background information. This includes:

  • Your current code context

  • Environment configuration (specific to Jinja environments)

  • Predefined requirements and constraints

  • Guidelines for response style and formatting

This comprehensive initialization ensures that Copilot has the necessary context to provide accurate and relevant assistance tailored to the specific component where Copilot is activated.

Jinja components

When working with Jinja components, Snoweaver will generate a system prompt that includes the following background information:

  • Request Copilot to assume the role of a Jinja developer.

  • Provide Copilot with the code from the associated component.

  • Include any supported Macros defined in the job or the macro library.

  • Provide the Jinja environment context (generated by the debug extension).

  • Specify that the output must be in JSON format if specified by the job.

Below are examples of using Copilot in this context:

../_images/8.png ../_images/3.png

Function definition

In the definition editor on the Functions page, Snoweaver will generate a system prompt that includes the following background information:

  • Request Copilot to assume the role of a Python developer.

  • Provide Copilot with the code from the editor.

  • Provide specific guidelines for structure and formatting.

  • Instruct Copilot to check if any required packages are missing from the provided list of packages.

Here is an example of using Copilot in this context:

../_images/5.png

Web request preview

For the web request preview function, Snoweaver will generate a system prompt that includes the following background information:

  • Provide the content of the HTTP web request prepared with the test values.

Here is an example of using Copilot in this context:

../_images/4b.png

Omitting system prompt

To prevent Copilot from using the system prompt, select the Omit context option.

Below are examples of using Copilot without the system prompt:

../_images/7.png ../_images/6.png

Considerations

Copilot costs

  • Snoweaver Copilot leverages Snowflake’s Cortex LLM COMPLETE function, which incurs compute costs. For detailed information, refer to Snowflake’s Cortext Cost considerations .

  • Chat history enables Copilot to process all previous questions and responses along with the prompt to Cortex. As the chat history grows, token consumption increases proportionally. To manage this, you can click the New Chat button to clear the current history and start a fresh chat.

  • By default, Copilot processes your questions within a system context. The token consumption for this context varies based on the size of your code and the complexity of your Jinja environment, including variables, functions, and macros used in the job. For general questions, you can select the omit context option. This excludes the system context, reducing token usage and potentially speeding up response times.

Copilot configuration

  • To achieve optimal response quality, we recommend using the most recent language models. These updates have shown substantial enhancements in performance.

  • For cost efficiency, set a small or medium-sized model as the default. Offer users access to one or two larger, high-quality models as alternatives, ensuring they have options if the default responses do not meet their needs.

For further details, please refer to this page: Choosing a model