Skip to content

Instantly share code, notes, and snippets.

@chris1642
chris1642 / AutoPopulateSelectedMeasureDescriptionsFromOpenAIWithDelay.csx
Last active March 1, 2023 17:48 — forked from dgosbell/AutoPopulateMeasureDescriptionsFromOpenAIWithDelay.csx
Update Selected Tabular Model Descriptions from ChatGPT with rate limiting logic
#r "System.Net.Http"
using System.Net.Http;
using System.Text;
using Newtonsoft.Json.Linq;
// You need to signin to https://platform.openai.com/ and create an API key for your profile then paste that key
// into the apiKey constant below
const string apiKey = "YOUR API KEY HERE";
const string uri = "https://api.openai.com/v1/completions";
const string question = "Explain the following calculation in a few sentences in simple business terms without using DAX function names:\n\n";