
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/">
    <channel>
        <title><![CDATA[ The Cloudflare Blog ]]></title>
        <description><![CDATA[ Get the latest news on how products at Cloudflare are built, technologies used, and join the teams helping to build a better Internet. ]]></description>
        <link>https://blog.cloudflare.com</link>
        <atom:link href="https://blog.cloudflare.com/" rel="self" type="application/rss+xml"/>
        <language>en-us</language>
        <image>
            <url>https://blog.cloudflare.com/favicon.png</url>
            <title>The Cloudflare Blog</title>
            <link>https://blog.cloudflare.com</link>
        </image>
        <lastBuildDate>Sat, 04 Apr 2026 10:58:29 GMT</lastBuildDate>
        <item>
            <title><![CDATA[Introducing Cursor: the Cloudflare AI Assistant]]></title>
            <link>https://blog.cloudflare.com/introducing-cursor-the-ai-assistant-for-docs/</link>
            <pubDate>Mon, 15 May 2023 13:00:42 GMT</pubDate>
            <description><![CDATA[ Check out Cursor - our experimental AI assistant trained to answer questions about Cloudflare’s Developer Platform! ]]></description>
            <content:encoded><![CDATA[ 
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1VAjf7x1mfBG0W9mVTgOGV/06ecaa94b96579f3b5c9afc5fdf1fa3f/cursor-OG.png" />
            
            </figure><p>Today we’re excited to be launching Cursor – <a href="https://developers.cloudflare.com/workers/ai/">our experimental AI assistant</a>, trained to answer questions about Cloudflare’s Developer Platform. This is just the first step in our journey to help developers build in the fastest way possible using AI, so we wanted to take the opportunity to share our vision for a generative developer experience.</p><p>Whenever a new, disruptive technology comes along, it’s not instantly clear what the native way to interact with that technology will be.</p><p>However, if you’ve played around with Large Language Models (LLMs) such as ChatGPT, it’s easy to get the feeling that this is something that’s going to change the way we work. The question is: how? While this technology already feels super powerful, today, we’re still in the relatively early days of it.</p><p>While Developer Week is all about meeting developers where they are, this is one of the things that’s going to change just that — where developers are, and how they build code. We’re already seeing the beginnings of how the way developers write code is changing, and adapting to them. We wanted to share with you how we’re thinking about it, what’s on the horizon, and some of the large bets to come.</p>
    <div>
      <h2>How is AI changing developer experience?</h2>
      <a href="#how-is-ai-changing-developer-experience">
        
      </a>
    </div>
    <p>If there’s one big thing we can learn from the exploding success of ChatGPT, it’s the importance of pairing technology with the right interface. GPT-3 — the technology powering ChatGPT has been around for some years now, but the masses didn’t come until ChatGPT made it accessible to the masses.</p><p>Since the primary customers of our platform are developers, it’s on us to find the right interfaces to help developers move fast on our platform, and we believe AI can unlock unprecedented developer productivity. And we’re still in the beginning of that journey.</p>
    <div>
      <h3>Wave 1: AI generated content</h3>
      <a href="#wave-1-ai-generated-content">
        
      </a>
    </div>
    <p>One of the things ChatGPT is exceptionally good at is generating new content and articles. If you’re a bootstrapped developer relations team, the first day playing around with ChatGPT may have felt like you struck the jackpot of productivity. With a simple inquiry, ChatGPT can generate in a few seconds a tutorial that would have otherwise taken hours if not days to write out.</p><p>This content still needs to be tested — do the code examples work? Does the order make sense? While it might not get everything right, it’s a massive productivity boost, allowing a small team to multiply their content output.</p><p>In terms of developer experience, examples and tutorials are crucial for developers, especially as they start out with a new technology, or seek validation on a path they’re exploring.</p><p>However, with <a href="https://www.cloudflare.com/learning/ai/what-is-generative-ai/">AI generated</a> content, it’s always going to be limited to well, how much of it you generated. To compare it to the newspaper, this content is still one size fits all. If as a developer you stray ever so slightly off the beaten path (choose a different framework than the one tutorial suggests, or a different database), you’re still left to put the pieces together, navigating tens of open tabs in order to stitch together your application.</p><p>If this content is already being generated by AI, however, why not just go straight to the source, and allow developers to generate their own, personal guides?</p>
    <div>
      <h3>Wave 2: Q&amp;A assistants</h3>
      <a href="#wave-2-q-a-assistants">
        
      </a>
    </div>
    <p>Since developers love to try out new technologies, it’s no surprise that developers are going to be some of the early adopters for technology such as ChatGPT. Many developers are already starting to build applications alongside their trusted bard, ChatGPT.</p><p>Rather than using generated content, why not just go straight to the source, and ask ChatGPT to generate something that’s tailored specifically for you?</p><p>There’s one tiny problem: the information is not always up to date. Which is why plugins are going to become a super important way to interact.</p><p>But what about someone who’s already on Cloudflare’s docs? Here, you want a native experience where someone can ask questions and receive answers. Similarly, if you have a question, why spend time searching the docs, if you can just ask and receive an answer?</p>
    <div>
      <h3>Wave 3: generative experiences</h3>
      <a href="#wave-3-generative-experiences">
        
      </a>
    </div>
    <p>In the examples above, you were still relying on switching back and forth between a dedicated AI interface and the problem at hand. In one tab you’re asking questions, while in another, you’re implementing the answers.</p><p>But taking things another step further, what if AI just met you where you were? In terms of developer experience, we’re already starting to see this in the authoring phase. Tools like GitHub Copilot help developers generate boilerplate code and tests, allowing developers to focus on more complex tasks like designing architecture and algorithms.</p><p>Sometimes, however, the first iteration AI comes up with might not match what you, the developer had in mind, which is why we’re starting to experiment with a flow-based generative approach, where you can ask AI to generate several versions, and build out your design with the one that matches your expectations the most.</p><p>The possibilities are endless, enabling developers to start applications from prompts rather than pre-generated templates.</p><p>We’re excited for all the possibilities AI will unlock to make developers more productive than ever, and we’d love to hear from you how AI is changing the way you change applications.</p><p>We’re also excited to share our first steps into the realm of AI driven developer experience with the release of our first two ChatGPT plugins, and by welcoming a new member of our team —Cursor, our docs AI assistant.</p>
    <div>
      <h2>Our first milestone to AI driven UX: AI Assisted Docs</h2>
      <a href="#our-first-milestone-to-ai-driven-ux-ai-assisted-docs">
        
      </a>
    </div>
    <p>As the first step towards using AI to streamline our developer experience, we’re excited to introduce a new addition to our documentation to help you get answers as quickly as possible.</p>
    <div>
      <h3>How to use Cursor</h3>
      <a href="#how-to-use-cursor">
        
      </a>
    </div>
    <p>Here’s a sample exchange with Cursor:</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2KTPs50lW0D4CjAheccUCL/6e7e2956d835574681a72a6487bca28c/image2-7.png" />
            
            </figure><p>You’ll notice that when you ask a question, it will respond with two pieces of information: a text based response answering your questions, and links to relevant pages in our documentation that can help you go further.</p><p>Here’s what happens when we ask “What video formats does Stream support?”.</p><div></div>
<p></p><p>If you were looking through our examples you may not immediately realize that this specific example uses both Workers and R2.</p><p>In its current state, you can think of it as your assistant to help you learn about our products and navigate our documentation in a conversational way. We’re labeling Cursor as experimental because this is the very beginning stages of what we feel like a Cloudflare AI assistant could do to help developers. It is helpful, but not perfect. To deal with its lack of perfection, we took an approach of having it do fewer things better. You’ll find there are many things it isn’t good at today.</p>
    <div>
      <h3>How we built Cursor</h3>
      <a href="#how-we-built-cursor">
        
      </a>
    </div>
    <p>Under the hood, Cursor is powered by Workers, Durable Objects, OpenAI, and the Cloudflare developer docs. It uses the same backend that we’re using to power our ChatGPT Docs plugin, and you can read about that <a href="/cloudflare-chatgpt-plugins/">here</a>.</p><p>It uses the <a href="https://github.com/openai/openai-cookbook/blob/main/examples/Question_answering_using_embeddings.ipynb">“Search-Ask” method</a>, stay tuned for more details on how you can build your own.</p>
    <div>
      <h2>A sneak peek into the future</h2>
      <a href="#a-sneak-peek-into-the-future">
        
      </a>
    </div>
    <p>We’re already thinking about the future, we wanted to give you a small preview of what we think this might look like here:</p><div></div>
<p></p><p>With this type of interface, developers could use a UI to have an AI generate code and developers then link that code together visually. Whether that’s with other code generated by the AI or code they’ve written themselves. We’ll be continuing to explore interfaces that we hope to help you all build more efficiently and can’t wait to get these new interfaces in your hands.</p>
    <div>
      <h2>We need your help</h2>
      <a href="#we-need-your-help">
        
      </a>
    </div>
    <p>Our hope is to quickly update and iterate on how Cursor works as developers around the world use it. As you’re using it to explore our documentation, <a href="http://discord.cloudflare.com/">join us on Discord</a> to let us know your experience.</p>
    <div>
      <h3>Watch on Cloudflare TV</h3>
      <a href="#watch-on-cloudflare-tv">
        
      </a>
    </div>
    <div></div> ]]></content:encoded>
            <category><![CDATA[Developer Week]]></category>
            <category><![CDATA[Developers]]></category>
            <category><![CDATA[AI]]></category>
            <category><![CDATA[ChatGPT]]></category>
            <category><![CDATA[OpenAI]]></category>
            <category><![CDATA[Cloudflare Workers]]></category>
            <category><![CDATA[Product News]]></category>
            <category><![CDATA[Developer Platform]]></category>
            <guid isPermaLink="false">3ddhB1ezlTOGPv7Dd6uOsR</guid>
            <dc:creator>Ricky Robinett</dc:creator>
            <dc:creator>Rita Kozlov</dc:creator>
        </item>
        <item>
            <title><![CDATA[Query Cloudflare Radar and our docs using ChatGPT plugins]]></title>
            <link>https://blog.cloudflare.com/cloudflare-chatgpt-plugins/</link>
            <pubDate>Mon, 15 May 2023 13:00:32 GMT</pubDate>
            <description><![CDATA[ We’re excited to share two new Cloudflare ChatGPT plugins – the Cloudflare Radar plugin and the Cloudflare Docs plugin ]]></description>
            <content:encoded><![CDATA[ 
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/13OKMGwTZyyLLic6XwPfQd/4a942e67cba851aae4420f25a17f94ad/image7-6.png" />
            
            </figure><p>When OpenAI launched ChatGPT plugins in alpha we knew that it opened the door for new possibilities for both Cloudflare users and developers building on Cloudflare. After the launch, our team quickly went to work seeing what we could build, and today we’re very excited to share with you two new Cloudflare ChatGPT plugins – the Cloudflare Radar plugin and the Cloudflare Docs plugin.</p><p>The Cloudflare Radar plugin allows you to talk to ChatGPT about real-time Internet patterns powered by <a href="https://radar.cloudflare.com/">Cloudflare Radar</a>.</p><p>The Cloudflare Docs plugin allows developers to use ChatGPT to help them write and build Cloudflare applications with the most up-to-date information from our documentation. It also serves as an open source example of how to build a ChatGPT plugin with Cloudflare Workers.</p><p>Let’s do a deeper dive into how each of these plugins work and how we built them.</p>
    <div>
      <h3>Cloudflare Radar ChatGPT plugin</h3>
      <a href="#cloudflare-radar-chatgpt-plugin">
        
      </a>
    </div>
    <p>When ChatGPT introduced <a href="https://openai.com/blog/chatgpt-plugins">plugins</a>, one of their use cases was retrieving real-time data from third-party applications and their APIs and letting users ask relevant questions using natural language.</p><p><a href="https://radar.cloudflare.com/">Cloudflare Radar</a> has lots of data about how people use the Internet, a well-documented <a href="https://developers.cloudflare.com/radar/">public API</a>, an OpenAPI specification, and it’s entirely <a href="/technology-behind-radar2/">built on top of Workers</a>, which gives us lots of flexibility for improvements and extensibility. We had all the building blocks to create a ChatGPT plugin quickly. So, that's what we did.</p><p>We added an <a href="https://api.radar.cloudflare.com/.well-known/ai-plugin.json">OpenAI manifest endpoint</a> which describes what the plugin does, some branding assets, and an <a href="https://api.radar.cloudflare.com/.well-known/openai-schema.json">enriched OpenAPI schema</a> to tell ChatGPT how to use our data APIs. The longest part of our work was fine-tuning the schema with good descriptions (written in natural language, obviously) and examples of how to query our endpoints.</p><p>Amusingly, the descriptions ended up much improved by the need to explain the API endpoints to ChatGPT. An interesting side effect is that this benefits us humans also.</p>
            <pre><code>{
    "/api/v1/http/summary/ip_version": {
        "get": {
            "operationId": "get_SummaryIPVersion",
            "parameters": [
                {
                    "description": "Date range from today minus the number of days or weeks specified in this parameter, if not provided always send 14d in this parameter.",
                    "required": true,
                    "schema": {
                        "type": "string",
                        "example": "14d",
                        "enum": ["14d","1d","2d","7d","28d","12w","24w","52w"]
                    },
                    "name": "dateRange",
                    "in": "query"
                }
            ]
        }
    }</code></pre>
            <p>Luckily, <a href="https://github.com/cloudflare/itty-router-openapi">itty-router-openapi</a>, an easy and compact OpenAPI 3 schema generator and validator for Cloudflare Workers that we built and <a href="/technology-behind-radar2/">open-sourced</a> when we launched Radar 2.0, made it really easy for us to add the missing parts.</p>
            <pre><code>import { OpenAPIRouter } from '@cloudflare/itty-router-openapi'

const router = OpenAPIRouter({
  aiPlugin: {
    name_for_human: 'Cloudflare Radar API',
    name_for_model: 'cloudflare_radar',
    description_for_human: "Get data insights from Cloudflare's point of view.",
    description_for_model:
      "Plugin for retrieving the data based on Cloudflare Radar's data. Use it whenever a user asks something that might be related to Internet usage, eg. outages, Internet traffic, or Cloudflare Radar's data in particular.",
    contact_email: 'radar@cloudflare.com',
    legal_info_url: 'https://www.cloudflare.com/website-terms/',
    logo_url: 'https://cdn-icons-png.flaticon.com/512/5969/5969044.png',
  },
})</code></pre>
            <p>We incorporated our changes into itty-router-openapi, and now it <a href="https://github.com/cloudflare/itty-router-openapi#aiplugin">supports</a> the OpenAI manifest and route, and a few other <a href="https://github.com/cloudflare/itty-router-openapi#openai-plugin-support">options</a> that make it possible for anyone to build their own ChatGPT plugin on top of Workers too.</p><p>The Cloudflare Radar ChatGPT is available to non-free ChatGPT users or anyone on OpenAI’s plugin's <a href="https://openai.com/waitlist/plugins">waitlist</a>. To use it, simply open <a href="https://chat.openai.com/">ChatGPT</a>, go to the Plugin store and install Cloudflare Radar.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3R2uxXouXE7NMwAXwzwuLS/4cf0e59cbe09e0f429a06d74e141a206/image6-6.png" />
            
            </figure><p>Once installed, you can talk to it and ask questions about our data using natural language.</p><p>When you add plugins to your account, ChatGPT will prioritize using their data based on what the language model understands from the human-readable descriptions found in the manifest and Open API schema. If ChatGPT doesn't think your prompt can benefit from what the plugin provides, then it falls back to its standard capabilities.</p><p>Another interesting thing about plugins is that they extend ChatGPT's limited knowledge of the world and events after 2021 and can provide fresh insights based on recent data.</p><p>Here are a few examples to get you started:</p><p><b>"What is the percentage distribution of traffic per TLS protocol version?"</b></p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1emtbmUbCUo2RhILUplHft/3789e6672bd172c5d6e3d17ce56f283c/download--5--3.png" />
            
            </figure><p><b>"What's the HTTP protocol version distribution in Portugal?"</b></p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2ADYGYFmtoTb1MUa3YVdzP/5fb35fa683292e30c87a5bbcaa772a2e/download-8.png" />
            
            </figure><p>Now that ChatGPT has context, you can add some variants, like switching the country and the date range.</p><p><b>“How about the US in the last six months?”</b></p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3RKxEE4nzqd5cBMOUfVBlH/14812d97f2fc04aa118bcd401275957d/download--1--5.png" />
            
            </figure><p>You can also combine multiple topics (ChatGPT will make multiple API calls behind the scenes and combine the results in the best possible way).</p><p><b>“How do HTTP protocol versions compare with TLS protocol versions?”</b></p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5kwMCXTMv3vQHmqdpFft2E/f0a525b78399b761a80d4aba84bb6096/download--2--4.png" />
            
            </figure><p>Out of ideas? Ask it “<b>What can I ask the Radar plugin?</b>”, or “<b>Give me a random insight</b>”.</p><p>Be creative, too; it understands a lot about our data, and we keep improving it. You can also add date or country filters using natural language in your prompts.</p>
    <div>
      <h3>Cloudflare Docs ChatGPT plugin</h3>
      <a href="#cloudflare-docs-chatgpt-plugin">
        
      </a>
    </div>
    <p>The Cloudflare Docs plugin is a <a href="https://openai.com/blog/chatgpt-plugins#retrieval">ChatGPT Retrieval Plugin</a> that lets you access the most up-to-date knowledge from our developer documentation using ChatGPT. This means if you’re using ChatGPT to assist you with building on Cloudflare that the answers you’re getting or code that’s being generated will be informed by current best practices and information located within our docs. You can set up and run the Cloudflare Docs ChatGPT Plugin by following the read me in <a href="https://github.com/cloudflare/chatgpt-plugin/tree/main/example-retrieval-plugin">the example repo</a>.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/HTxO668NzSVaOOZ525ZtE/976dd480de0d58039a57f98ae2accb09/image1-20.png" />
            
            </figure><p>The plugin was built entirely on Workers and uses <a href="https://developers.cloudflare.com/workers/learning/how-kv-works/">KV</a> as a vector store. It can also keep its index up-to-date using <a href="https://developers.cloudflare.com/workers/platform/triggers/cron-triggers/">Cron Triggers</a>, <a href="https://developers.cloudflare.com/queues/">Queues</a> and <a href="https://developers.cloudflare.com/workers/runtime-apis/durable-objects/">Durable Objects</a>.</p><p>The plugin is a Worker that responds to POST requests from ChatGPT to a <code>/query</code> endpoint. When a query comes in, the Worker converts the query text into an <a href="https://platform.openai.com/docs/guides/embeddings">embedding vector via the OpenAI embeddings API</a> and uses this to find, and return, the most relevant document snippets from Cloudflare’s developer documentation.</p><p>The way this is achieved is by first converting every document in Cloudflare’s developer documentation on GitHub into embedding vectors (again using OpenAI’s API) and storing them in KV. This storage format allows you to find semantically similar content by doing a <a href="https://en.wikipedia.org/wiki/Similarity_search">similarity search</a> (we use <a href="https://en.wikipedia.org/wiki/Cosine_similarity">cosine similarity</a>), where two pieces of text that are similar in meaning will result in the two embedding vectors having a high similarity score. Cloudflare’s entire developer documentation compresses to under 5MB when converted to embedding vectors, so fetching these from KV is very quick. We’ve also explored building larger vector stores on Workers, as can be seen in <a href="https://ai.cloudflare.com/demos/vector-store/">this demo of 1 million vectors stored on Durable Object storage</a>. We’ll be releasing more open source libraries to support these vector store use cases in the near future.</p><p>So ChatGPT will query the plugin when it believes the user’s question is related to Cloudflare’s developer tools, and the plugin will return a list of up-to-date information snippets directly from our documentation. ChatGPT can then decide how to use these snippets to best answer the user’s question.</p><p>The plugin also includes a “Scheduler” Worker that can periodically refresh the documentation embedding vectors, so that the information is always up-to-date. This is advantageous because ChatGPT’s own knowledge has a cutoff of September 2021 – so it’s not aware of changes in documentation, or new Cloudflare products.</p><p>The Scheduler Worker is triggered by a <a href="https://developers.cloudflare.com/workers/platform/triggers/cron-triggers/">Cron Trigger</a>, on a schedule you can set (eg, hourly), where it will check which content has changed since it last ran via GitHub’s API. It then sends these document paths in messages to a <a href="https://developers.cloudflare.com/queues/">Queue</a> to be processed. Workers will batch process these messages – for each message, the content is fetched from GitHub, and then turned into embedding vectors via OpenAI’s API. A <a href="https://developers.cloudflare.com/workers/runtime-apis/durable-objects/">Durable Object</a> is used to coordinate all the Queue processing so that when all the batches have finished processing, the resulting embedding vectors can be combined and stored in KV, ready for querying by the plugin.</p><p>This is a great example of how Workers can be used not only for front-facing HTTP APIs, but also for scheduled batch-processing use cases.</p>
    <div>
      <h3>Let us know what you think</h3>
      <a href="#let-us-know-what-you-think">
        
      </a>
    </div>
    <p>We are in a time when technology is constantly changing and evolving, so as you experiment with these new plugins please let us know what you think. What do you like? What could be better? Since ChatGPT plugins are in alpha, changes to the plugins user interface or performance (i.e. latency) may occur. If you build your own plugin, we’d love to see it and if it’s open source you can submit a pull request on our <a href="https://github.com/cloudflare/chatgpt-plugin">example repo</a>. You can always find us hanging out in our <a href="http://discord.cloudflare.com/">developer discord</a>.</p>
    <div>
      <h3>Watch on Cloudflare TV</h3>
      <a href="#watch-on-cloudflare-tv">
        
      </a>
    </div>
    <div></div> ]]></content:encoded>
            <category><![CDATA[Developer Week]]></category>
            <category><![CDATA[ChatGPT]]></category>
            <category><![CDATA[AI]]></category>
            <category><![CDATA[OpenAI]]></category>
            <category><![CDATA[Cloudflare Workers]]></category>
            <category><![CDATA[Developers]]></category>
            <category><![CDATA[Developer Platform]]></category>
            <guid isPermaLink="false">1V5D6mOrE8HfIU7fkANorJ</guid>
            <dc:creator>Ricky Robinett</dc:creator>
            <dc:creator>Celso Martinho</dc:creator>
            <dc:creator>Michael Hart</dc:creator>
        </item>
        <item>
            <title><![CDATA[Magic in minutes: how to build a ChatGPT plugin with Cloudflare Workers]]></title>
            <link>https://blog.cloudflare.com/magic-in-minutes-how-to-build-a-chatgpt-plugin-with-cloudflare-workers/</link>
            <pubDate>Fri, 12 May 2023 19:05:00 GMT</pubDate>
            <description><![CDATA[ Announcing our new Quickstart example for building ChatGPT Plugins with Cloudflare Workers ]]></description>
            <content:encoded><![CDATA[ <p></p><p>Today, we're open-sourcing our <a href="https://github.com/cloudflare/chatgpt-plugin/tree/main/example-plugin">ChatGPT Plugin Quickstart repository for Cloudflare Workers</a>, designed to help you build awesome and versatile plugins for ChatGPT with ease. If you don’t already know, ChatGPT is a conversational AI model from <a href="https://www.openai.com/">OpenAI</a> which has an uncanny ability to take chat input and generate human-like text responses.</p><p>With the recent addition of <a href="https://www.cloudflare.com/learning/ai/chatgpt-plugins/">ChatGPT plugins</a>, developers can create custom extensions and integrations to make ChatGPT even more powerful. Developers can now provide custom flows for ChatGPT to integrate into its conversational workflow – for instance, the ability to look up products when asking questions about shopping, or retrieving information from an <a href="https://www.cloudflare.com/learning/security/api/what-is-an-api/">API</a> in order to have up-to-date data when working through a problem.</p><p>That's why we're super excited to contribute to the growth of ChatGPT plugins with our new Quickstart template. Our goal is to make it possible to build and deploy a new ChatGPT plugin to production in minutes, so developers can focus on creating incredible conversational experiences tailored to their specific needs.</p>
    <div>
      <h2>How it works</h2>
      <a href="#how-it-works">
        
      </a>
    </div>
    <p>Our Quickstart is designed to work seamlessly with <a href="https://workers.cloudflare.com">Cloudflare Workers</a>. Under the hood, it uses our command-line tool <a href="https://developers.cloudflare.com/workers/cli-wrangler"><code>wrangler</code></a> to create a new project and deploy it to Workers.</p><p>When building a ChatGPT plugin, there are three things you need to consider:</p><ol><li><p>The plugin's metadata, which includes the plugin's name, description, and other info</p></li><li><p>The plugin's schema, which defines the plugin's input and output</p></li><li><p>The plugin's behavior, which defines how the plugin responds to user input</p></li></ol><p>To handle all of these parts in a simple, easy-to-understand API, we've created the <a href="https://www.npmjs.com/package/@cloudflare/itty-router-openapi"><code>@cloudflare/itty-router-openapi</code> package</a>, which makes it easy to manage your plugin's metadata, schema, and behavior. This package is included in the ChatGPT Plugin Quickstart, so you can get started right away.</p><p>To show how the package works, we'll look at two key files in the ChatGPT Plugin Quickstart: <code>index.js</code> and <code>search.js</code>. The <code>index.js</code> file contains the plugin's metadata and schema, while the <code>search.js</code> file contains the plugin's behavior. Let's take a look at each of these files in more detail.</p><p>In <code>index.js</code>, we define the plugin's metadata and schema. The metadata includes the plugin's name, description, and version, while the schema defines the plugin's input and output.</p><p>The configuration matches the definition required by <a href="https://platform.openai.com/docs/plugins/getting-started/plugin-manifest">OpenAI's plugin manifest</a>, and helps ChatGPT understand what your plugin is, and what purpose it serves.</p><p>Here's what the <code>index.js</code> file looks like:</p>
            <pre><code>import { OpenAPIRouter } from "@cloudflare/itty-router-openapi";
import { GetSearch } from "./search";

export const router = OpenAPIRouter({
  schema: {
    info: {
      title: 'GitHub Repositories Search API',
      description: 'A plugin that allows the user to search for GitHub repositories using ChatGPT',
      version: 'v0.0.1',
    },
  },
  docs_url: '/',
  aiPlugin: {
    name_for_human: 'GitHub Repositories Search',
    name_for_model: 'github_repositories_search',
    description_for_human: "GitHub Repositories Search plugin for ChatGPT.",
    description_for_model: "GitHub Repositories Search plugin for ChatGPT. You can search for GitHub repositories using this plugin.",
    contact_email: 'support@example.com',
    legal_info_url: 'http://www.example.com/legal',
    logo_url: 'https://workers.cloudflare.com/resources/logo/logo.svg',
  },
})

router.get('/search', GetSearch)

// 404 for everything else
router.all('*', () =&gt; new Response('Not Found.', { status: 404 }))

export default {
  fetch: router.handle
}</code></pre>
            <p>In the <code>search.js</code> file, we define the plugin's behavior. This is where we define how the plugin responds to user input. It also defines the plugin's schema, which ChatGPT uses to validate the plugin's input and output.</p><p>Importantly, this doesn't just define the <i>implementation</i> of the code. It also automatically generates an OpenAPI schema that helps ChatGPT understand how your code works -- for instance, that it takes a parameter "q", that it is of "String" type, and that it can be described as "The query to search for". With the schema defined, the <code>handle</code> function makes any relevant parameters available as function arguments, to implement the logic of the endpoint as you see fit.</p><p>Here's what the <code>search.js</code> file looks like:</p>
            <pre><code>import { ApiException, OpenAPIRoute, Query, ValidationError } from "@cloudflare/itty-router-openapi";

export class GetSearch extends OpenAPIRoute {
  static schema = {
    tags: ['Search'],
    summary: 'Search repositories by a query parameter',
    parameters: {
      q: Query(String, {
        description: 'The query to search for',
        default: 'cloudflare workers'
      }),
    },
    responses: {
      '200': {
        schema: {
          repos: [
            {
              name: 'itty-router-openapi',
              description: 'OpenAPI 3 schema generator and validator for Cloudflare Workers',
              stars: '80',
              url: 'https://github.com/cloudflare/itty-router-openapi',
            }
          ]
        },
      },
    },
  }

  async handle(request: Request, env, ctx, data: Record&lt;string, any&gt;) {
    const url = `https://api.github.com/search/repositories?q=${data.q}`

    const resp = await fetch(url, {
      headers: {
        'Accept': 'application/vnd.github.v3+json',
        'User-Agent': 'RepoAI - Cloudflare Workers ChatGPT Plugin Example'
      }
    })

    if (!resp.ok) {
      return new Response(await resp.text(), { status: 400 })
    }

    const json = await resp.json()

    // @ts-ignore
    const repos = json.items.map((item: any) =&gt; ({
      name: item.name,
      description: item.description,
      stars: item.stargazers_count,
      url: item.html_url
    }))

    return {
      repos: repos
    }
  }
}</code></pre>
            <p>The quickstart smooths out the entire development process, so you can focus on crafting custom behaviors, endpoints, and features for your ChatGPT plugins without getting caught up in the nitty-gritty. If you aren't familiar with API schemas, this also means that you can rely on our schema and manifest generation tools to handle the complicated bits, and focus on the implementation to build your plugin.</p><p>Besides making development a breeze, it's worth noting that you're also deploying to Workers, which takes advantage of Cloudflare's vast global network. This means your ChatGPT plugins enjoy low-latency access and top-notch performance, no matter where your users are located. By combining the strengths of Cloudflare Workers with the versatility of ChatGPT plugins, you can create conversational AI tools that are not only powerful and scalable but also cost-effective and globally accessible.</p>
    <div>
      <h2>Example</h2>
      <a href="#example">
        
      </a>
    </div>
    <p>To demonstrate the capabilities of our quickstarts, we've created two example ChatGPT plugins. The first, which we reviewed above, connects ChatGPT with the GitHub Repositories Search API. This plugin enables users to search for repositories by simply entering a search term, returning useful information such as the repository's name, description, star count, and URL.</p><p>One intriguing aspect of this example is the property where the plugin could go beyond basic querying. For instance, when asked "What are the most popular JavaScript projects?", ChatGPT was able to intuitively understand the user's intent and craft a new query parameter for querying both by the number of stars (measuring popularity), and the specific programming language (JavaScript) without requiring any explicit prompting. This showcases the power and adaptability of ChatGPT plugins when integrated with external APIs, providing more insightful and context-aware responses.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/zNnhkg7XeayfWqrmncoGV/d73078e55a3274613810871371498fba/1847-2.png" />
            
            </figure><p>The second plugin uses the <a href="https://pirate-weather.apiable.io/">Pirate Weather API</a> to retrieve up-to-date weather information. Remarkably, OpenAI is able to translate the request for a specific location (for instance, “Seattle, Washington”) into longitude and latitude values – which the Pirate Weather API uses for lookups – and make the correct API request, without the user needing to do any additional work.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/12clMhHEuroetJ1P3wqTgP/ceb2fc9984a193ff1dde09a671246864/1847-4.png" />
            
            </figure><p>With our ChatGPT Plugin Quickstarts, you can create custom plugins that connect to any API, database, or other data source, giving you the power to create ChatGPT plugins that are as unique and versatile as your imagination. The possibilities are endless, opening up a whole new world of conversational AI experiences tailored to specific domains and use cases.</p>
    <div>
      <h2>Get started today</h2>
      <a href="#get-started-today">
        
      </a>
    </div>
    <p><a href="https://github.com/cloudflare/chatgpt-plugin/tree/main/example-plugin">The ChatGPT Plugin Quickstarts</a> don’t just make development a snap—it also offers seamless deployment and scaling thanks to Cloudflare Workers. With the generous free plan provided by Workers, you can deploy your plugin quickly and scale it infinitely as needed.</p><p>Our ChatGPT Plugin Quickstarts are all about sparking creativity, speeding up development, and empowering developers to create amazing conversational AI experiences. By leveraging Cloudflare Workers' robust infrastructure and our streamlined tooling, you can easily build, deploy, and scale custom ChatGPT plugins, unlocking a world of endless possibilities for conversational AI applications.</p><p>Whether you're crafting a virtual assistant, a customer support bot, a language translator, or any other conversational AI tool, our ChatGPT Plugin Quickstarts are a great place to start. We're excited to provide this Quickstart, and would love to see what you build with it. <a href="https://discord.com/invite/cloudflaredev">Join us</a> in our Discord community to share what you're working on!</p> ]]></content:encoded>
            <category><![CDATA[Cloudflare Workers]]></category>
            <category><![CDATA[Developers]]></category>
            <category><![CDATA[Serverless]]></category>
            <category><![CDATA[ChatGPT]]></category>
            <category><![CDATA[Developer Week]]></category>
            <category><![CDATA[AI]]></category>
            <category><![CDATA[Developer Platform]]></category>
            <guid isPermaLink="false">4iStRh6jdgrcRyOkbG9E74</guid>
            <dc:creator>Kristian Freeman</dc:creator>
        </item>
    </channel>
</rss>