Skip to content

Conversation

@adinsmoor-openai
Copy link

Summary

This PR adds a GPT Action example for Snowflake Cortex Analyst.

Motivation

This allows users to integrate with Snowflake semantic view definitions when enabling analytics via ChatGPT.


For new content

When contributing new content, read through our contribution guidelines, and mark the following action items as completed:

  • [x ] I have added a new entry in registry.yaml (and, optionally, in authors.yaml) so that my content renders on the cookbook website.
  • I have conducted a self-review of my content based on the contribution guidelines:
    • Relevance: This content is related to building with OpenAI technologies and is useful to others.
    • Uniqueness: I have searched for related examples in the OpenAI Cookbook, and verified that my content offers new insights or unique information compared to existing documentation.
    • Spelling and Grammar: I have checked for spelling or grammatical mistakes.
    • Clarity: I have done a final read-through and verified that my submission is well-organized and easy to understand.
    • Correctness: The information I include is correct and all of my code executes successfully.
    • Completeness: I have explained everything fully, including all necessary references and citations.

We will rate each of these areas on a scale from 1 to 4, and will only accept contributions that score 3 or higher on all areas. Refer to our contribution guidelines for more details.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +136 to +143
"**Context**: You are an expert at writing Snowflake Semantic View requests and explaining SQL queries + their results. A user is going to ask you a question. \n",
"\n",
"**Instructions**:\n",
"1. If the user's question could be answered with a SQL query, try sending to the sendCortexAnalystMessage action to request that information from Snowflake. ALWAYS use this action first before trying to write your own SQL. Use semantic_view: {database}.{schema}.{your_semantic_view} by default. \n",
"2. ALWAYS show the generated SQL to the user, explain what info it retrieved succinctly, and ask if they'd like to execute it.\n",
"3. If so, call the runQuery action. Use the <your_role> role when querying Snowflake\n",
"\n",
"**Additional Notes**: If the user says \"Let's get started\", explain that the user can provide a project or dataset, along with a question they want answered. If the user has no ideas, suggest that we have a semantic model on food truck order data that they can explore. Additionally, the data spans only 2019-2022."

Choose a reason for hiding this comment

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

P1 Badge runQuery action referenced but not defined

The GPT instructions tell the model to call a runQuery action after generating SQL, but the manifest in this notebook only defines a single sendCortexAnalystMessage operation and contains no runQuery path or operationId anywhere else. That means the workflow described in step 3 cannot be executed—the action will return an OpenAPI validation error or simply never expose a runQuery call—leaving users unable to execute the SQL the instructions ask for.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants