<?xml version="1.0" encoding="UTF-8"?><rss 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" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Alex Novotny on Medium]]></title>
        <description><![CDATA[Stories by Alex Novotny on Medium]]></description>
        <link>https://medium.com/@anovotny_12970?source=rss-246952a91969------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*L3-AdWjDbLj1t0a8gfAULg.jpeg</url>
            <title>Stories by Alex Novotny on Medium</title>
            <link>https://medium.com/@anovotny_12970?source=rss-246952a91969------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 06:18:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@anovotny_12970/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Weaviate + Box RAG recipe with Weaviate Query Agent]]></title>
            <link>https://medium.com/box-developer-blog/weaviate-box-rag-recipe-with-weaviate-query-agent-1cb41cf9e68b?source=rss-246952a91969------2</link>
            <guid isPermaLink="false">https://medium.com/p/1cb41cf9e68b</guid>
            <category><![CDATA[agents]]></category>
            <category><![CDATA[box]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Alex Novotny]]></dc:creator>
            <pubDate>Wed, 19 Mar 2025 17:08:39 GMT</pubDate>
            <atom:updated>2025-03-19T17:08:39.686Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MYR6pwC8gi2Gp95Ivzzc_A.png" /></figure><p>Today, I’m thrilled to share a new demo hitting the <a href="https://github.com/weaviate/recipes/tree/main/integrations/data-platforms/box">Weaviate GitHub recipe repository</a>, straight from the <a href="https://developer.box.com/">BoxDev</a> team! This end-to-end example walks you through building a Retrieval-Augmented Generation (RAG) workflow by embedding <a href="https://www.box.com/">Box</a> content into a <a href="https://weaviate.io/">Weaviate</a> vector database and leveraging Weaviate’s shiny new <a href="https://weaviate.io/blog/weaviate-agents">Query Agent</a> (just launched in March 2025) to answer questions about your data. Whether you’re a developer, data enthusiast, or just curious about AI-powered search, this recipe has something for you.</p><p>Let’s dive in! ✅</p><h3>Overview</h3><p>Before we jump into the nitty-gritty, let’s set the stage with some key concepts and introductions.</p><h4><strong>What is Box?</strong></h4><p>Box is the leading Intelligent Content Management platform for securely storing, sharing, and collaborating on files. Think of it as your digital filing cabinet — except it’s way smarter, with APIs that let developers create custom workflows around their content. In this recipe, we’re using Box to store documents that we’ll later search and query, making it the foundation of our RAG pipeline.</p><h4><strong>What is Weaviate?</strong></h4><p>Weaviate is an open-source vector database that’s built for speed, scale, and AI-driven search. It stores data as objects and vectors, letting you combine semantic search (via embeddings) with structured filtering. It’s cloud native and fault tolerant, and integrates directly with large language models (LLMs). Here, Weaviate acts as our storage and search engine, powering the magic of agentic RAG with its new Query Agent.</p><h4>How do these solutions create an end-to-end RAG solution?</h4><p>RAG is a technique that pairs a vector search (retrieval) with a language model (generation) to answer questions using your own data. Here’s the high-level flow.</p><ol><li><strong>Content storage</strong>: Box holds your files (e.g., PDFs, docs, or text reports)</li><li><strong>Embedding creation</strong>: The extracted text from these files is chunked, and embeddings are generated (numerical representations) using Weaviate<a href="https://weaviate.io/developers/wcs/embeddings"> Embeddings</a></li><li><strong>Querying</strong>: Weaviate’s Query Agent takes a natural language question, generates multiple search and aggregate queries as needed, and then forms one output to the user — all in one go using agentic RAG.</li></ol><p>This combo lets you ask specific questions about your content and get smart, context-aware responses without hallucinated nonsense.</p><p>Pretty cool, right?</p><h3><strong>Recipe walkthrough</strong></h3><p>Let’s go through the steps to get this RAG workflow up and running, based on the demo we released today. You’ll need a <a href="https://jupyter.org/">Jupyter Notebook</a> environment (e.g., <a href="https://code.visualstudio.com/docs/datascience/jupyter-notebooks">Visual Studio Code</a> or local setup) to follow along.</p><h4><strong>Get a Box developer token</strong></h4><p>If you don’t already have a Box account,<a href="https://account.box.com/signup/developer#ty9l3"> sign up for a free developer account</a>.</p><p>For the recipe, you’ll need a Box developer token:</p><ul><li>Log into the<a href="https://cloud.app.box.com/developers/console"> Box Developer Console</a>.</li><li>Create a new app (choose “Custom App” with “Standard OAuth 2.0” authentication). You may name it whatever you would like to. Read/write all files scopes should be added for this example. Click “Save changes” in the top right.</li><li>Generate a developer token under the “Configuration” tab. This token <strong><em>lasts 60 minutes</em></strong>, so you’ll need to renew it if you take longer than that to complete the demo.</li><li>Save this token; you’ll plug it into the notebook later.</li></ul><h4><strong>Create a Weaviate Account</strong></h4><p>You will also need a Weaviate Cloud cluster. It is super simple to get one.</p><ul><li>Sign up on <a href="https://console.weaviate.cloud/">Weaviate Cloud</a> for a free sandbox tier.</li><li>Create a new cluster in the WCD dashboard. You can name it whatever you would like.</li><li>Grab your cluster URL and API key from the “Details” tab; you’ll plug it into the notebook later.</li></ul><h4><strong>Download recipe and complete step by step</strong></h4><p>Clone or download the repository from GitHub.</p><ul><li>Visit the<a href="https://github.com/weaviate/recipes/tree/main"> Weaviate recipe GitHub repository</a>.</li><li>You can either download the code as a zip folder or clone the repository.</li><li>Inside the folder, you’ll find an integrations folder, followed by a data-platforms folder. Find the Box folder inside and open the Jupyter Notebook in the development environment of your choice.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r6vqtfKHAPTku_A_Du6N7Q.png" /><figcaption>Find the weaviate_box Jupyter Notebook</figcaption></figure><p>Inside the Box folder, there’s another folder called demo_files that’s preloaded with four 10-K financial reports to use for the demo. If you’d like to use another set of files, you’re welcome to delete those files and replace them with your own.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zdrUSgQcxgh9dk7tk73fWA.png" /><figcaption>Weaviate Box recipe repository</figcaption></figure><p>Make sure to update the Box and Weaviate authentication variables in step 3’s code block, which you noted down in the setup earlier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7cVYXLDuQEFiDupPQRNqAQ.png" /><figcaption>Add in authentication variables in step 3</figcaption></figure><p>To run this notebook, you simply run each section. If you have the notebook VS Code extension installed, you can simply press “Play” on each code block.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IpLhv2K4Iq2xelh5dZwJMA.png" /><figcaption>Hit the play button if using VS Code</figcaption></figure><p>Once complete, you should see something like to as the final response. You’re welcome to update the query in step 7 to another question based on the 10-K’s included and/or ask questions on custom content you added.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5pD9mB0sVCSIG9ZCxfFFZg.png" /><figcaption>Final answer returned based on query and content</figcaption></figure><h3><strong>Next steps</strong></h3><p>You’ve got a working RAG demo — now what?</p><ul><li><strong>Expand your data</strong>: Upload more files to Box (e.g., annual reports, articles) and rerun the notebook.</li><li><strong>Tweak the agent</strong>: Adjust the system_prompt to make answers more detailed or formal (e.g., “Provide a detailed analysis…”)</li><li><strong>Explore other agents</strong>: Weaviate’s Transformation Agent could preprocess your data, or the Personalization Agent could tailor responses (both in preview — check<a href="https://weaviate.io/developers/agents"> weaviate.io/developers/agents</a>).</li></ul><p>This recipe blends Box’s Intelligent Content Management with Weaviate’s vector search and Query Agent to create a powerful, AI-driven search tool. It’s a glimpse into how modern platforms can team up to make your data smarter and more accessible.</p><p><em>As always, we’re excited to hear your feedback and stories on the </em><a href="https://community.box.com/box-platform-5"><em>Box Developer Community</em></a><em>. </em>🦄</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1cb41cf9e68b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/box-developer-blog/weaviate-box-rag-recipe-with-weaviate-query-agent-1cb41cf9e68b">Weaviate + Box RAG recipe with Weaviate Query Agent</a> was originally published in <a href="https://medium.com/box-developer-blog">Box Developer Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[NEW!] Box AI API updates]]></title>
            <link>https://medium.com/box-developer-blog/new-box-ai-api-updates-e812b868457d?source=rss-246952a91969------2</link>
            <guid isPermaLink="false">https://medium.com/p/e812b868457d</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[box]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Alex Novotny]]></dc:creator>
            <pubDate>Wed, 19 Feb 2025 17:01:51 GMT</pubDate>
            <atom:updated>2025-02-19T17:01:51.708Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VpPmbsn45XMd26b55uyRqQ.png" /></figure><p>Today, Box has completed a <strong>huge</strong> release of several features that developers have been waiting for.</p><p>We’re incredibly excited to announce the rollout of Box AI capabilities to our customers on <strong>Business</strong>, <strong>Business Plus</strong>, and <strong>Enterprise</strong> plans. Users can now access unlimited document and image querying via Box Preview in the Box web app. We’re also enhancing this experience with Box AI seamlessly embedded into the side panel, and enabling users to provide feedback on AI response quality in an easy and intuitive way. Coming soon, customers in Individual, Personal Pro, and Starter plans can expect to leverage these Box AI capabilities as well.</p><p>Here’s what else is new…</p><h4>Box AI API general availability and pricing</h4><p>As organizations increasingly integrate AI into their user experiences and workflows, understanding and managing their AI consumption becomes critical. Traditional pricing models often fall short when it comes to measuring the dynamic value AI delivers. Recognizing this need, Box is introducing <strong>Box AI Units</strong> as a new way to track and manage AI API usage AI usage more transparently . Each AI interaction — from querying content to extracting metadata — is quantified into discrete units, enabling businesses to forecast AI needs and optimize budgets with clarity and precision.</p><p>Contact your Box sales representative to find out more on availability and pricing specifics for your specific Box instance.</p><h3>Box AI API with images</h3><p>The Box AI<a href="https://developer.box.com/reference/post-ai-ask/"> ask endpoint</a> now supports querying images. You use the endpoints in the same way as before, but using an image file will now return information about that image.</p><p>For example, for this image…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/998/1*K_3ysobhcIeATlqcXe5z4g.png" /><figcaption>Lab report</figcaption></figure><p>running the below cURL snippet….</p><pre>curl -i -L POST &quot;https://api.box.com/2.0/ai/ask&quot; \<br>    -H &quot;content-type: application/json&quot; \<br>    -H &quot;authorization: Bearer TOKEN&quot; \<br>    -d &#39;{<br>        &quot;mode&quot;: &quot;single_item_qa&quot;,<br>        &quot;prompt&quot;: &quot;What results should be followed up on?&quot;,<br>        &quot;items&quot;: [<br>           {<br>           &quot;type&quot;: &quot;file&quot;,<br>           &quot;id&quot;: &quot;FILE_ID&quot;<br>           }<br>        ]<br>     }&#39;</pre><p>will return a response like this…</p><pre>{<br>   &quot;answer&quot;: &quot;The blood test results for John Doe indicate that the following values should be followed up on:\n\n1. **Hemoglobin (Hb)**: The result is 12.2 g/dL, which is below the reference range of 13.0 - 17.0 g/dL, indicating a low hemoglobin level.\n2. **Platelet Count**: The result is 150000 cumm, which is at the borderline of the reference range of 150000 - 410000 cumm.\n\nThese deviations from the normal ranges suggest potential health issues that may require further investigation or medical intervention.&quot;,<br>   &quot;created_at&quot;: &quot;2025-02-18T07:16:21.492-08:00&quot;,<br>   &quot;completion_reason&quot;: &quot;done&quot;,<br>   &quot;ai_agent_info&quot;: {<br>       &quot;models&quot;: [{<br>           &quot;name&quot;: &quot;azure__openai__gpt_4o&quot;,<br>           &quot;provider&quot;: &quot;azure&quot;<br>       }],<br>       &quot;processor&quot;: &quot;basic_image&quot;<br>   }<br>}</pre><p>Box AI extract agents, <a href="https://developer.box.com/reference/post-ai-extract/">freeform</a> and<a href="https://developer.box.com/reference/post-ai-extract-structured/"> structured</a>, also support images, so you can extract critical metadata and attach to images to get a comprehensive view of your content.</p><p>Box AI handles image documents with a resolution of 1024×1024 pixels, with a maximum of 5 images or 5 pages for multi-page images. If the number of image or image pages exceeds 5, the first 5 images or pages will be processed. If you set mode parameter to single_item_qa, the items array can have one element only. Currently Box AI does not support multi-modal requests. If both images and text are sent Box AI will only process the text.</p><h3>Box AI API with Box Hubs</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*98BNUKtn_izUa9UvxGSdkg.png" /><figcaption>Box AI with Box Hubs</figcaption></figure><p>The Box AI API <a href="https://developer.box.com/reference/post-ai-ask/">ask endpoint</a> now supports querying a Box Hub. Inputing hubs as the items type parameter, alongside a hub id (copied from a URL bar) and mode of single_item_qa will return information based on all content in a Box Hub.</p><p>For example, running the below cURL snippet…</p><pre>curl -i -L POST &quot;https://api.box.com/2.0/ai/ask&quot; \<br>     -H &quot;content-type: application/json&quot; \<br>     -H &quot;authorization: Bearer TOKEN&quot; \<br>     -d &#39;{<br>         &quot;mode&quot;: &quot;single_item_qa&quot;,<br>         &quot;prompt&quot;: &quot;PROMPT&quot;,<br>         &quot;items&quot;: [<br>            {<br>            &quot;type&quot;: &quot;hubs&quot;,<br>            &quot;id&quot;: &quot;HUB_ID&quot;<br>            }<br>         ]<br>      }&#39;</pre><p>will return a response like this…</p><pre>{<br>  &quot;answer&quot;: &quot;ANSWER&quot;,<br>  &quot;created_at&quot;: &quot;DATE&quot;,<br>  &quot;completion_reason&quot;: &quot;done&quot;,<br>  &quot;ai_agent_info&quot;: {<br>    &quot;models&quot;: [{<br>      &quot;name&quot;: &quot;mlp__bge_large_gpu&quot;,<br>      &quot;provider&quot;: &quot;mlp&quot;,<br>      &quot;supported_purpose&quot;: &quot;embedding&quot;<br>    }, {<br>      &quot;name&quot;: &quot;azure__openai__gpt_4o_mini&quot;,<br>      &quot;provider&quot;: &quot;azure&quot;<br>    }],<br>    &quot;processor&quot;: &quot;long_text_multi&quot;<br>  }<br>}</pre><p>In order for a Box Hub to be queried by Box AI, both Box Hubs and Box AI must be turned on in the Box Admin Console. The Box Hub must have been indexed (which happens automatically) and have less than 10,000 files. Box Hubs are only available to Enterprise Plus and above license tiers. For the most up to date limitations, view<a href="https://support.box.com/hc/en-us/articles/29347206309395-Box-AI-for-Hubs"> this</a> support page.</p><h3>Box AI Studio API</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TGRbGEzR99Y-4p16NZ0XQg.jpeg" /><figcaption>Box AI Studio</figcaption></figure><p>The<a href="https://developer.box.com/reference/resources/ai-multiple-agent-response/"> Box AI Studio API</a> enables developers to create and deploy powerful Box AI agents specifically tailored to their unique needs — for instance, asking Box AI to act as a consulting expert that helps teams understand complex IT requirements to help address client concerns. The API extends the capabilities of the front-end launch of<a href="https://www.box.com/ai/ai-studio"> Box AI Studio</a> released a couple months back, allowing Box admins and co-admins to generate and use Box AI agents almost immediately without using the front end.</p><h3>Box for Salesforce updates</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*___OkO_uiazICef5" /><figcaption>Box Doc Gen for Salesforce</figcaption></figure><p>Our Box for Salesforce team has launched several updates that will make working with Box AI even easier. Checkout the release notes <a href="https://support.box.com/hc/en-us/articles/38552461563795-Box-for-Salesforce-v4-71-Release-Notes">here</a>.</p><p>With Box Doc Gen for Salesforce, teams can dynamically generate custom documents without leaving Salesforce, eliminating the need to manually create, modify, and process mission-critical documents — a process which can be tedious, time-consuming, and error-prone, resulting in significant productivity drains. This functionality can be installed using the default<a href="https://appexchange.salesforce.com/appxListingDetail?listingId=a0N30000001qNeKEAU"> managed package</a> in the app exchange, and utilizes<a href="https://developer.box.com/guides/docgen/"> Box Doc Gen</a> behind the scenes to create content.</p><h3>Box AI API support for scanned documents</h3><p>The Box AI API metadata extraction<a href="https://developer.box.com/reference/post-ai-extract/"> freeform</a> and<a href="https://developer.box.com/reference/post-ai-extract-structured/"> structured</a> endpoints can now support scanned documents. The documents must be stored as PDF files, and the process will run automatically in the background if files do not have text representation.</p><p><em>Please note, handwritten documents may not process correctly.</em></p><h3>Wrap up</h3><p>Box is thrilled to launch all of these features today, and we can’t wait to see what you build with them. Make sure to check out our <a href="https://events.box.com/series/box-series-2025/landing_page?utm_source=GTM&amp;utm_medium=gtm&amp;utm_theme=CloudContentManagement&amp;id=701UL00000FwBVqYAN&amp;utm_content=dev-blog">launch webinar</a> focused on Box AI. We will be spotlighting Miller Tanner using the Extract API agents in one of the demos.</p><p>Until then, happy coding!</p><h4>Resources</h4><p>Box AI API <a href="https://developer.box.com/reference/resources/ai-agent-ask/">reference</a></p><p>Box AI API <a href="https://developer.box.com/guides/box-ai/">guides</a></p><p>Box AI API <a href="https://youtube.com/playlist?list=PLCSEWOlbcUyI2ta24oRr75_4igvMzKJ9q&amp;si=ybhjVwUJhFbsKDyu">YouTube series</a></p><p>🦄 <em>Want to engage with other Box Platform champions?</em></p><p><em>Join our</em><a href="https://community.box.com/box-platform-5"><em> Box Developer Community</em></a><em> for support and knowledge sharing!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e812b868457d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/box-developer-blog/new-box-ai-api-updates-e812b868457d">[NEW!] Box AI API updates</a> was originally published in <a href="https://medium.com/box-developer-blog">Box Developer Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[NEW!] Announcing the Box Doc Gen API]]></title>
            <link>https://medium.com/box-developer-blog/new-announcing-the-box-doc-gen-api-42318564302f?source=rss-246952a91969------2</link>
            <guid isPermaLink="false">https://medium.com/p/42318564302f</guid>
            <category><![CDATA[box]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Alex Novotny]]></dc:creator>
            <pubDate>Wed, 22 Jan 2025 15:13:23 GMT</pubDate>
            <atom:updated>2025-02-03T10:14:46.871Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ov4-XLQwjzXusPoW26EBtg.jpeg" /></figure><p><a href="https://support.box.com/hc/en-us/articles/36412833521939-Announcing-the-Box-Doc-Gen-API">Starting now</a>, you can use our brand-new product,<a href="https://cloud.app.box.com/s/assem86wb9u8u2919c15hrmn57eqopul"> Box Doc Gen</a>, via the<a href="https://developer.box.com/"> Box Doc Gen API</a>. This new innovation allows you to programmatically generate business documents, such as offer letters, sales contracts, invoices and agreements. Generated documents are based on templates previously created and uploaded to Box, with data fields that can be dynamically filled. Plus, data can come from any number of sources, such as third party applications,<a href="https://www.box.com/apps"> Box Apps</a>, and more!</p><p>Let’s see how it works.</p><h3>Tutorial</h3><p>Below, you’ll find a tutorial on how to generate an NDA using the Box Doc Gen API. The steps are broken into three parts: creating the template, labeling the template, and generating a document. The examples shown are in cURL to be framework agnostic, but our latest<a href="https://github.com/box/sdks"> Box SDK libraries</a> are updated so you can use them if you wish.</p><blockquote>This tutorial demonstrates product usage only and should not be construed as legal advice or guidance for drafting NDAs. All processes shown are illustrative examples.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*modS7eogwADHvlbY-Q4PRg.png" /><figcaption>Box Doc Gen API flow</figcaption></figure><h4>Pre-requisites</h4><p>Before you can use Box Doc Gen via the API, you’ll need to complete the following actions.</p><ul><li>Your Box instance must have a subscription plan that includes Box Doc Gen. Developer accounts <strong>do not</strong> include Box Doc Gen. Reach out to your Box sales representative for more information if you would like to try out these features.</li><li>To use Box Doc Gen, you must have access to Microsoft Word, as it is required for creating and authoring your document templates. Box Doc Gen is designed to facilitate the dynamic generation of business documents, but it is important to note that Box does not have control over users’ access to Microsoft Word. Users must ensure they have the necessary permissions and access to Microsoft Word to create and author document templates effectively.</li><li>Box Doc Gen must be enabled by an admin in the<a href="https://app.box.com/master"> Admin Console</a>. If you are your instance’s Box Admin, you will find the necessary information on how to turn on this setting in the<a href="https://support.box.com/hc/en-us/articles/4404822772755-Enterprise-Settings-Content-Sharing-Tab#h_01FYQGK5RW42T07GV985MQ9E9A"> Enterprise Settings: Content &amp; Sharing Tab</a> documentation.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qhiaQFkuuZZbH3bOsbWhkQ.png" /><figcaption>Box Admin Console Doc Gen configuration</figcaption></figure><ul><li>The appropriate scope must be added to a Box custom application. You can use any type of application. Find out how to set an app up in our<a href="https://staging.developer.box.com/guides/getting-started/first-application/"> developer docs</a>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jYndL7pRZb57ukYKyKjLjA.png" /><figcaption>Manage Box Gen application setting</figcaption></figure><h4>Create template</h4><p>To begin, we need to create a template that can be used to generate a NDA for a new client. You can download<a href="https://cloud.box.com/s/szil1ecjmh4ih0d9rzqzghek6dc3404p"> this</a> document to jump-start creating the template, or you can create your own from scratch. This NDA example also contains<a href="https://support.box.com/hc/en-us/articles/4404085855251-Creating-templates-using-tags"> Box Sign template tags</a>, so a document can be sent for signature after creation.</p><p>While it’s not required to use Microsoft Word to create the template, it can make it significantly easier — thanks to the<a href="https://appsource.microsoft.com/en-us/product/office/wa200007137?tab=overview"> Box Doc Gen add-in for Microsoft Word</a>. No matter how the document is created, it will need to be saved as a DOCX file type in order to generate documents with Box Doc Gen.</p><p>After downloading the file linked above, open it Microsoft Word. If using the plugin, install the add-in using<a href="https://support.box.com/hc/en-us/articles/36587535449747-Install-the-Box-Doc-Gen-Add-In-for-Microsoft-Word"> these</a> instructions. After installing the plugin you can then<a href="https://support.box.com/hc/en-us/articles/36148012877843-Authoring-a-Box-Doc-Gen-Template-using-your-Sample-JSON-data-and-the-Box-Doc-Gen-Add-in-for-Microsoft-Word"> use a JSON object to generate tags</a> or<a href="https://support.box.com/hc/en-us/articles/36151895655059-Authoring-a-Box-Doc-Gen-template-manually-using-the-Box-Doc-Gen-Add-in-for-Microsoft-Word"> manually create them</a>.</p><p>Also, note that you can use Microsoft Word online if you don’t wish to work with the file locally.</p><p>For this walkthrough, you can use<a href="https://cloud.box.com/s/j621z7rrvytjvzda4oao17a5j2nhrkyi"> this</a> JSON file for the NDA template we are creating.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uiS3tBAqVYrD5O-PdZBp4Q.png" /><figcaption>Open Box Doc Gen plugin</figcaption></figure><p>Click start with your data, followed by uploading the JSON file you downloaded. It should look like the below screenshot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D9nQeQs2zvgHVYsm7cZ29A.png" /><figcaption>Upload JSON file</figcaption></figure><p>After clicking “Generate tags,” you will see fields that can be used in the document.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KWkiWkRJB3SQjfHDDw16qQ.png" /><figcaption>Click “Generate tags”</figcaption></figure><p>Add fields by placing your cursor where you’d like a value to go. Then, click the field in the list. In the screenshot below, fields that have been added are highlighted.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RXOIHHC0IcRfNsZq6yp9XA.png" /><figcaption>Add your fields</figcaption></figure><p>In addition to the JSON data, you can also add conditional logic using IF statements. Let’s add an “if” so that Part 3 of the document will only show if the NDA signer is in California.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BJRMgTjHgCjQ1L97vyfaTw.png" /><figcaption>Insert conditional statement</figcaption></figure><p>Save the document. Make sure its DOCX.</p><h4>Mark template</h4><p>Now, let’s upload the document to Box and mark it as a Box Doc Gen template. You can do this in a few ways.</p><p>You could simply upload the file to Box (wherever you’d like to store it). Then, in the options menu, select “Mark as Doc Gen Template.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4Ru8NuIYUbOM4CtQRDyW0g.png" /><figcaption>Option 1 for marking file as a template</figcaption></figure><p>Or, you could go into the Relay Doc Gen menu, and create/upload it there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dpi4DIythS-yGdoB_IFlwA.png" /><figcaption>Option 2 for marking file as a template</figcaption></figure><p>Finally, you could also use the <a href="https://developer.box.com/reference/v2025.0/post-docgen-templates/">Box Platform API</a> to mark a file in Box as a template.</p><pre>curl -L &#39;https://api.box.com/2.0/docgen_templates&#39; \<br>     -H &#39;box-version: 2025.0&#39; \<br>     -H &#39;Authorization: Bearer &lt;ACCESS_TOKEN&gt;&#39; \<br>     -H &#39;Content-Type: application/json&#39; \<br>     -D &#39;{<br>        &quot;file&quot;: {<br>            &quot;id&quot;: &quot;12345678&quot;,<br>            &quot;type&quot;: &quot;file&quot;<br>        }<br>}&#39;</pre><p>Regardless of how you designate your template, you should see the file appear afterwards in the Doc Gen tab of the Relay menu option.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3DcVxFNfXvV0OBGjpjzFaA.png" /><figcaption>Box Doc Gen Relay menu</figcaption></figure><p>It will also appear in results returned by the Box Platform API endpoint for listing out Box Doc Gen templates.</p><pre>{<br>  &quot;limit&quot;: 10,<br>  &quot;next_marker&quot;: null,<br>  &quot;prev_marker&quot;: null,<br>  &quot;entries&quot;: [{<br>    &quot;file&quot;: {<br>      &quot;id&quot;: &quot;1749734642013&quot;,<br>      &quot;type&quot;: &quot;file&quot;<br>    },<br>    &quot;file_name&quot;: &quot;Increo NDA Doc Gen Template.docx&quot;<br>  }]<br>}</pre><h4>Generate document</h4><p>After the above steps have been completed, you can generate a document using the template. Run the following command. Make sure to update the access token, file ID and destination folder ID, respectively.</p><pre>curl -L &#39;https://api.box.com/2.0/docgen_batches&#39; \<br>     -H &#39;box-version: 2025.0&#39; \<br>     -H &#39;Authorization: Bearer ACCESS_TOKEN&#39; \<br>     -d &#39;{<br>        &quot;file&quot;: {<br>            &quot;id&quot;: &quot;FILE_ID&quot;,<br>            &quot;type&quot;: &quot;file&quot;<br>        },<br>        &quot;input_source&quot;: &quot;api&quot;,<br>        &quot;destination_folder&quot;: {<br>            &quot;id&quot;: &quot;FOLDER_ID&quot;,<br>            &quot;type&quot;: &quot;folder&quot;<br>        },<br>        &quot;output_type&quot;: &quot;docx&quot;,<br>        &quot;document_generation_data&quot;: [<br>          {<br>            &quot;generated_file_name&quot;: &quot;Box Doc Gen Increo NDA&quot;,<br>            &quot;user_input&quot;: {<br>              &quot;contract&quot;: {<br>                &quot;date&quot;: &quot;18-08-2023&quot;,<br>                &quot;companyName&quot;: &quot;ABC Finance&quot;,<br>                &quot;clientName&quot;: &quot;Bob Smith&quot;,<br>                &quot;engagementType&quot;: &quot;Sprint Support&quot;,<br>                &quot;companyIndustry&quot;: &quot;Finance&quot;,<br>                &quot;customerAddress&quot;: {<br>                  &quot;state&quot;: &quot;CA&quot;<br>                }<br>              }<br>            }<br>          }<br>        ]<br>     }&#39;</pre><p>When a request to generate a document is completed, a job is created. The response you receive from the Box Platform API should look like this.</p><pre>{<br>  &quot;id&quot;: &quot;d770504e-18a2-487f-baf9-7e6ec7d260e6&quot;,<br>  &quot;type&quot;: &quot;docgen_batch&quot;<br>}</pre><p>While one-off tutorials like this will be quick, larger more scaled projects may take more time. Also, since you can generate several documents in one call, they are batched together. You can use the endpoints described on<a href="https://developer.box.com/guides/docgen/docgen-jobs/"> this page</a> to learn more about using the API to monitor job completion.</p><p>In addition to using the API to monitor job/batch progress, you can see all requests for a particular template in the Doc Gen activity tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SBGp3ckgsza5nubjj-2ekA.png" /><figcaption>Box Doc Gen activity monitor</figcaption></figure><p>You’ll also find direct links to the generated document.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uAbZU-PWzwhj4klGUX-aVw.png" /><figcaption>Generated document</figcaption></figure><p>And, since this NDA template has Box Sign tags, you could send it directly for signature using the Box UI or the API!</p><h3>Wrap up</h3><p>With this latest release, you can speed up time-consuming processes with document creation across your organization.</p><p>Also, it’s worth noting that this tutorial only demonstrated Box Doc Gen as a standalone solution., but you can use document generation in tandem with other Box products too. For example, you can send documents for signature after you generate them.</p><p><strong>Stay tuned</strong> — next week we will release an SDK-based workshop on Box Doc Gen similar to the one we released on<a href="https://github.com/box-community/Box-AI-Workshop"> Box AI</a>.</p><h4>More Box Doc Gen endpoints</h4><p>We’ve released additional Doc Gen endpoints. Learn more from our<a href="https://developer.box.com/reference/v2025.0/resources/docgen-batch--base/"> API reference pages</a>.</p><h4>Resources</h4><p><a href="https://appsource.microsoft.com/en-us/product/office/WA200007137?tab=Overview">Box Doc Gen Microsoft Word plugin</a></p><p><a href="https://developer.box.com/guides/docgen/">Box Doc Gen guides</a></p><p><a href="https://developer.box.com/reference/v2025.0/resources/docgen-batch--base/">Box Doc Gen API reference</a></p><p>🦄 <em>Want to engage with other Box Platform champions?</em></p><p><em>Join our</em><a href="https://community.box.com/box-platform-5"><em> Box Developer Community</em></a><em> for support and knowledge sharing!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=42318564302f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/box-developer-blog/new-announcing-the-box-doc-gen-api-42318564302f">[NEW!] Announcing the Box Doc Gen API</a> was originally published in <a href="https://medium.com/box-developer-blog">Box Developer Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Box apps & integrations naming convention updates]]></title>
            <link>https://medium.com/box-developer-blog/box-apps-naming-updates-479e65ce6a4c?source=rss-246952a91969------2</link>
            <guid isPermaLink="false">https://medium.com/p/479e65ce6a4c</guid>
            <category><![CDATA[development]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[workflow-automation]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[box]]></category>
            <dc:creator><![CDATA[Alex Novotny]]></dc:creator>
            <pubDate>Tue, 17 Dec 2024 12:32:02 GMT</pubDate>
            <atom:updated>2024-12-17T12:32:02.241Z</atom:updated>
            <content:encoded><![CDATA[<h3>Box Apps &amp; Integrations naming convention updates</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*heRbmBbe72XRTSuP0AVAHQ.png" /><figcaption>Box apps dashboard</figcaption></figure><p>Following up on the <strong>HUGE</strong> <a href="https://boxworks.box.com/boxworks?">BoxWorks</a> announcements of <a href="https://cloud.app.box.com/s/0u397aodryf4w82p0qo2ju4afyfd70ek">Forms</a>, <a href="https://cloud.app.box.com/s/assem86wb9u8u2919c15hrmn57eqopul">Doc Gen</a>, and <a href="https://www.box.com/apps">Box Apps</a> — Box Platform has recently made some <a href="https://developer.box.com/changelog/#2024-11-12-naming-change-apps-integrations">changes</a> to the naming of several Box features to streamline our product offering.</p><h3>Renaming specifics</h3><p>The new naming conventions will be different based on how you use Box. Below is the breakdown of the updates. In general, anywhere “applications” or “apps” was written has been updated to “integrations” or “Platform apps”.</p><h4>Developers</h4><p>For developers, the first place you will notice changes is in the header and menu of the Box Developer Console. The word “Platform” has been added in front of all the locations where it used to just say “apps.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CS2rsId8jY2TiQNzYQJoZQ.png" /><figcaption>Box Developer Console header</figcaption></figure><p>Within the settings for a particular application, the forth tab is now called Box Web Integrations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OpZ6B7hgxkxzwYEglvLZuQ.png" /><figcaption>Box web integration tab</figcaption></figure><p>Also, the fifth tab is now called publishing, and you can submit your application to Box Integrations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I8yP-mXmNjEHlcuk0KxvwA.png" /><figcaption>Box OAuth 2.0 publishing tab</figcaption></figure><h4>Admins</h4><p>In the Box Admin Console, the Custom Apps Manager has been updated to Platform Apps Manager. The buttons and descriptions have also been updated with “Platform.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ipXi5iiFkX65UY2WyDPEeQ.png" /><figcaption>Platform apps manager</figcaption></figure><h4>Box Shield</h4><p>Within Box Shield, app restriction has been updated to integration restriction under the Access Policies tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PZCNwJneein2-1EqHFqBCQ.png" /><figcaption>Box Shield access policy restriction</figcaption></figure><p>Under the Box Shield Detection Rules tab, you can now exclude integrations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PsGCbIr3KSRXAAcGY4BHNg.png" /><figcaption>Box Shield detection rules</figcaption></figure><p>Under the Box Shield Lists tab, you can now create a list for integrations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bSGzbB5lAq7ptr29GJ5vNw.png" /><figcaption>Box Shield lists</figcaption></figure><h4>Users</h4><p>For front end users, the App Marketplace tab has been updated to Integrations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pL903WijnPm4UEVbt1HGYA.png" /><figcaption>Box Integrations home page</figcaption></figure><p>🦄 <em>Want to engage with other Box Platform champions?</em></p><p><em>Join our</em><a href="https://community.box.com/box-platform-5"><em> Box Developer Community </em></a><em>for support and knowledge sharing!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=479e65ce6a4c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/box-developer-blog/box-apps-naming-updates-479e65ce6a4c">Box apps &amp; integrations naming convention updates</a> was originally published in <a href="https://medium.com/box-developer-blog">Box Developer Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build a content portal using Box UI Elements, React, Tailwind CSS, Vercel, and Auth0 — Part 3]]></title>
            <link>https://medium.com/box-developer-blog/build-a-content-portal-using-box-ui-elements-react-tailwind-css-vercel-and-auth0-part-3-6833d4724bcc?source=rss-246952a91969------2</link>
            <guid isPermaLink="false">https://medium.com/p/6833d4724bcc</guid>
            <category><![CDATA[tailwind-css]]></category>
            <category><![CDATA[auth0]]></category>
            <category><![CDATA[box]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Alex Novotny]]></dc:creator>
            <pubDate>Wed, 27 Nov 2024 17:20:45 GMT</pubDate>
            <atom:updated>2024-11-27T17:20:45.727Z</atom:updated>
            <content:encoded><![CDATA[<h3>Build a content portal using Box UI Elements, React, Tailwind CSS, Vercel, and Auth0 — Part 3</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SLycmKJia4j9d_TYAitIDA.jpeg" /><figcaption>Image by vectorjuice on <a href="https://www.freepik.com/author/vectorjuice">Freepik</a></figcaption></figure><p>Happy Thanksgiving 🦃 to those who celebrate, and welcome to the next part of our Box content portal series. In today’s tutorial, we will be looking at adding authentication to a custom portal. This is a semi-sequential tutorial series, so if you haven’t followed part 1 or 2 — you are welcome to go back and do that! If you just want to read along, continue on.</p><ul><li><a href="https://medium.com/box-developer-blog/build-a-content-portal-using-box-ui-elements-react-tailwind-css-vercel-part-1-f1c509621ceb">Build a content portal using Box UI Elements, React, Tailwind CSS &amp; Vercel Part 1</a></li><li><a href="https://medium.com/box-developer-blog/build-a-content-portal-using-box-ui-elements-react-tailwind-css-vercel-part-2-884915bb93a8">Build a content portal using Box UI Elements, React, Tailwind CSS &amp; Vercel Part 2</a></li></ul><h4>🚨IMPORTANT NOTE 🚨</h4><p>This tutorial and demo is for demonstration purposes only and <strong><em>is not production-ready</em></strong>. It lacks complete authentication and security measures, making it unsuitable for live environments without further development.</p><h3>Solution Overview</h3><p>In the previous parts, I showed a semi-customizable content portal. In this blog, we will be starting with a <strong>brand new code repository</strong>. This is due to the complexities of setting up a specific authentication provider. While I show Auth0 in this demo, you might have another IDP you are interested in. They are not all plug and play so to speak. They require some configuration, and every company or organization has their own security practices and policies.</p><p>In addition the authentication pieces, I’ve also refactored and reorganized the portal from parts 1/2. The look has also been refreshed.</p><h4>Why Auth0</h4><p>Before going further, I’d like to speak quickly on why I choose to use Auth0 as the example authentication provider for today’s demo. At Box, we consider ourselves the <a href="https://www.pcmag.com/encyclopedia/term/best-of-breed">best-of-breed</a> for <a href="https://www.box.com/workflow">Intelligent Content Management</a>. Similarly, Auth0 is widely considered a best-of-breed platform for developer-focused identity management and authentication, particularly recognized for its extensive flexibility, ease of integration, and focus on providing a smooth developer experience. I personally found their documentation to be above par, and their dashboard UI was easy to use and understand.</p><h4>Infrastructure diagram</h4><p>Here is a bird’s eye view of how all the pieces of the solution work together.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*05bE34TuHcwh_-VXkI8MUg.png" /><figcaption>Software architecture diagram of the content portal - <a href="https://www.tldraw.com/">tldraw</a></figcaption></figure><h3>Walkthrough</h3><p>Below, we will go through the steps to get the content portal setup locally on your machine, as well as deployed to Vercel.</p><h4>Prerequisites</h4><p>In order to complete the tutorial, you’ll need the below. Some of the items, you will be able to reuse from parts 1 &amp; 2 if you wish.</p><ul><li>An IDE, like <a href="https://code.visualstudio.com/download">VS Code</a></li><li><a href="https://git-scm.com/book/en/v2/Getting-Started-Installing-Git">Gi</a>t</li><li><a href="https://github.com/signup">GitHub</a> account</li><li><a href="https://cli.github.com/">Github CLI</a> — not required but highly recommended</li><li><a href="https://vercel.com/signup">Vercel</a> account — suggested to login/signup with GitHub account.</li><li><a href="https://auth0.com/signup?place=header&amp;type=button&amp;text=sign%20up">Auth0</a> account — suggested to login/signup with GitHub account.</li><li><a href="https://account.box.com/signup/developer#ty9l3">Box</a> account — must use a Box wide unique email address if using a developer account. <em>NOTE — only enterprise plus accounts will have access to Box AI functionality</em></li><li>Node 18.18.0 — install <a href="https://github.com/nvm-sh/nvm">NVM</a> to mangage and install other versions</li></ul><h4>Configure a Box Application</h4><p><em>Since you created a Box Platform application in parts 1/2, you may use the same one here; however I’m going to adjust the setup instructions to match recommended content portal settings and scopes. You are welcome to create a new one if you wish.</em></p><ol><li>Create a New Application: Go to the <a href="https://app.box.com/developers/console">Box Developer Console</a>, click ‘Create New App’, choose ‘Custom App’, name your app, then ‘Server Authentication with JWT’. <em>Note — We are using JWT due to our use of </em><a href="https://developer.box.com/platform/user-types/#service-account"><em>app users</em></a><em>.</em></li><li>Set Application Scopes: Ensure the application is configured with the following permissions: app access only, read/write all files, manage users, manage AI (<em>Note — Box AI is only available to Enterprise+ licenses and above</em>), make api calls using the as-user header, and generate user access tokens. <em>I choose the above scopes for the purposes of this demo; however, your specific needs may be different.</em></li><li>Enter <a href="http://localhost:3000/">http://localhost:3000</a> in the CORS domains box. Click Save Changes in the top right.</li><li>Generate a Public/Private Keypair: Click the button to generate a public/private keypair. Note this will require 2FA. You will have to set this up if you have done so before. A pop up will show you the steps to do so. After it is setup, you’ll need to click through the keypair flow again.</li><li>Download the JSON Config File: This file is automatically downloaded upon keypair generation. Keep this file close. We will need the information in this file in a future step. You are welcome to rename it as well.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/980/1*1ypPD1KCZwtW1GCJ8VAgxw.png" /><figcaption>Scopes set for the demo application</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yb9Kv8D3f34PyDlpMQPoRA.png" /><figcaption>Enter CORS domain</figcaption></figure><h4>Authorize the Box Application</h4><p>Like always, a server authentication application will need to be authorized by the administrator of the Box instance. Follow the steps outlined at <a href="https://developer.box.com/guides/authorization/custom-app-approval/">Custom App Approval</a> to authorize the application in the Box Admin Console. Post-authorization, a service account email is assigned to the app. <strong>Anytime changes are made to the app’s permissions and scopes, it will need to be reauthorized.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/388/1*GH06QTZ0jFhsq0a66Q2J7w.png" /><figcaption>Box admin server application authorization popup</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0apQ8E0d6SUIhR3Dh4U18A.png" /><figcaption>Where to find the service account email address</figcaption></figure><h4>Fork &amp; clone (or download) code repository</h4><p>If you have installed and configured the <a href="https://cli.github.com/">GitHub CLI</a>, you can run the following command to fork and clone <a href="https://github.com/box-community/box-custom-portal-demo-auth0">the repository</a> to your local machine. Make sure to run it in the directory you want the code to reside.</p><pre>gh repo fork box-community/box-custom-portal-demo-auth0 --clone=true</pre><p>You can also direct download the code to your local machine or you are welcome to clone it, but know that you will need to delete the .git file + switch the origin in order to deploy your own code to Vercel later on.</p><p>Once you have the code locally, change into the new directory and open it in your IDE.</p><pre>cd box-custom-portal-demo-auth0<br>code .</pre><h4>Initialize dummy content</h4><p>An init script and dummy files are included within the project to help automate some of the setup for running the demo.</p><p>Create an .env file based on the sample with this command.</p><pre>cp .env_example .env</pre><p>Open the newly created file. For this portion, we only need to fill out the Box JWT application variables. We will fill out the other variables later on. Copy the values from the JWT config file that was downloaded during Box Platform application setup. Paste in the values only — not the quotations.</p><p>If you haven’t, install pnpm globally.</p><pre>npm install -g pnpm</pre><p>Also, while we are here, go ahead and install the Vercel CLI globally if you have not done so.</p><pre>npm install -g vercel</pre><p>In the terminal, make sure to switch to node v.18.18.0. You might need to run the install command if you haven’t before.</p><pre>nvm use 18.18.0</pre><p>We are going to go ahead and install all the project dependancies now — since we need to use the <a href="https://github.com/box/box-node-sdk">Box Node SDK</a> for the init script.</p><pre>pnpm install</pre><p>Once that is complete, run the following command to setup the dummy folder and files.</p><pre>node  init.js</pre><p>Once complete, you should these logs in the terminal. Make sure to keep those ids and link close, as we will need them in a later step.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/1*i9FTwh92_8vJXjBh_XaF9A.png" /></figure><p>If you look in the main Box web app, you’ll notice that no folders or files appears. This is a great example of how Box security works! If you remember, the Box Platform application we setup used JWT with app access only. This means when we ran the init script and created content, it placed that content within the service account that represents the application not the user you are logged in with for the main Box web app.</p><p>If you would like to actually see the content that was created, you can do so from the content tab of the Box Admin Console. The init script created a Portal Demo folder within the root of the service account. Inside, there are three files: a logo image, a terms and conditions pdf and a dummy statement. We will use all of these in the subsquent steps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3AAM91JTXnhtXdsWiqYRvg.png" /><figcaption>Init dummy content</figcaption></figure><p>Before moving on, in your .env file you can paste in the terms and conditions file id as the REACT_APP_BOX_PREVIEW_FILE_ID variable. This file will be the same for all users.</p><h4>Auth0 application setup</h4><p>Now that we have setup the dummy content in Box, let’s move on to configuring our authentication provide Auth0. Like noted above, you should have already setup an account. If you haven’t, <a href="https://auth0.com/signup?place=header&amp;type=button&amp;text=sign%20up">do that now</a>. It is advised to signup with your GitHub account.</p><p>Once you get to the dashboard, select Applications on the left then click + Create Application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EeODtihXi0AfSqYkF_jSbA.png" /><figcaption>Click + Create Application</figcaption></figure><p>In the pop-up, give the application a name — followed by selecting Single Page Web Applications. Then, click Create.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/804/1*IM1bxkJCYEWv1wP3vnjBqg.png" /><figcaption>Select Single Page Web Applications</figcaption></figure><p>On the settings tab in the next window, find the Domain and Client ID. Copy both of those values into your .env file.</p><p>Scrolling further down the page, paste in the logo Box static link url you got from the init script earlier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zzAyaqCdnuWh3qU_ZSIypg.png" /><figcaption>Insert logo static link</figcaption></figure><p>Even further down the page, find the text boxes for the Application URIs. Enter <a href="http://localhost:3000/">http://localhost:3000</a>, <a href="http://localhost:3000/verify-email">http://localhost:3000/verify-email</a> in the Allowed Callback URLs box, and enter <a href="http://localhost:3000/">http://localhost:3000</a> in the Allowed Logout URLs and Allowed Web Origins boxes. Then, click Save Changes in the bottom right.</p><p><em>Note — we will add the Vercel deployed URLs here later.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-NCa26AtNyNIWkOtWSPGvQ.png" /><figcaption>Insert application URIs</figcaption></figure><p>In the connections tab, switch off the Google option. In the real world, you could leave this on or add other connection options, but for the purposes of the demo today, we will flip it off.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kNdTBqyn_c-j3UpcOp22TQ.png" /><figcaption>Turn off google OAuth 2.0</figcaption></figure><p>On the left side, select Branding. Then, click Email Templates. In the options, scroll down and paste {{ application.callback_domain }}/login?success=true&amp;message=Your%20email%20was%20verified.%20You%20can%20continue%20using%20the%20application. in the Redirect To field. Scroll down, and click Save.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LY-LnqJm0-DsdJHwxylodA.png" /><figcaption>Enter email verification redirect URL</figcaption></figure><p>While in the branding area, you are also welcome to change the colors of the login screen that will appear to users. This is optional.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vc0XhA5uGIErWRq_ayjaNQ.png" /><figcaption>Customize colors</figcaption></figure><p>Finally, go to Settings on the left. Scroll down, and insert Increo Financial as the Friendly Name and the static URL from the init script in the Logo URL field. Click Save.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CTxy2CzxJxbBjyxMMX_WZw.png" /><figcaption>Add logo and company name to settings</figcaption></figure><h4>Auth0 actions setup</h4><p>Now, we are going to set up three <a href="https://auth0.com/blog/introducing-auth0-actions/">Auth0 actions</a> (or serverless functions) for our application to use to create Box users, Box folders, and more! These are really cool, because once a user signs up or signs into the content portal, Auth0 can automatically do certain tasks ad-hoc, meaning you don’t need to have a backend running all the time.</p><p>The three actions are Verify Email, Add Metadata to User and Create Box App User. Verify Email makes sure that a user’s email is verified before allowing them to login. Add Metadata to User adds several Box ids from based on the user logging in. This allows Auth0 and Box to integrate seamlessly. Create Box App User creates a Box app user based on the user who signs up, as well as creates a folder tree and content for the new app user.</p><p>On the left side, click Actions -&gt; Library. Then, in the top right click Create Action -&gt; Build from scratch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xozEjh4EHDv9wlp8xzVnGA.png" /><figcaption>Click Create Action</figcaption></figure><p>Name the action Verify Email, and make sure the Trigger is set to Login/Post Login. Then, click Create.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/474/1*6Z0jj-K5woS3xeeCVX50bg.png" /><figcaption>Give the action a name</figcaption></figure><p>You can find the code for this function in the code repository that was forked and cloned under the auth0 directory. You will actually find the code for all three actions we are going to create.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XPXjlkyTRm1WA6R8rESRDQ.png" /><figcaption>Find the code samples</figcaption></figure><p>Copy/paste in the code for the action, and click Deploy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q5tUpIkaHSEhLWU5vjQetg.png" /><figcaption>Deploy Verify Email action</figcaption></figure><p>We are going to repeat these steps for both the addMetadataToUser and createBoxAppUser actions. For both of these two, you will need to add some secrets. After pasting in the code, you simply click add secret. Each action should get the following secrets BOX_CLIENT_ID, BOX_CLIENT_SECRET, BOX_KEY_ID, BOX_PRIVATE_KEY, BOX_PASSPHRASE, and BOX_ENTERPRISE_ID. For the value, just like in the .env file, paste values only not quotations.</p><p>The createBoxAppUser action is a tiny bit different. The trigger for it should be Post User Registration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/462/1*r_wdFh2Ro4hhxcvoY2ET2g.png" /><figcaption>Create Box App User action options</figcaption></figure><p>Also, this function has two extra secrets:PREVIEW_FILE_ID and DUMMY_STATEMENT_ID . You can grab those IDs from the output of the init script we ran at the beginning.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qpJh4D9X3l8IHezo8hm4xA.png" /><figcaption>Create Box App User action</figcaption></figure><p>On the right side for both Create Box App User and Add Metadata to User, make sure to add box-node-sdk as a dependency. You can do this, by clicking the tiny box under the key on the left side.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/455/1*XUwZs72vXlbY-HupK0iYRQ.png" /><figcaption>Add box-node-sdk dependency</figcaption></figure><p>Once secrets and dependencies are added and the code is pasted in, don’t forget to hit deploy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iu0Ys367YYOyZHKhnp-31A.png" /><figcaption>Click deploy</figcaption></figure><p>Once complete, you should see three custom actions in your library.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aENV_HhyqGp4xg4QsNpONg.png" /><figcaption>All actions created</figcaption></figure><p>Now, we need to add them to a trigger. Then, the code will run based upon the actions users make. On the left side, click Triggers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fPtuSvKISPFlMtzEZtRjYQ.png" /><figcaption>Open Triggers</figcaption></figure><p>Then, click post-user-registration. On the right side, select Custom and drag and drop the Create Box App User action into the trigger flow. Then, click Apply.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5SFprYLSbsFvr_6JWiI8Dw.png" /><figcaption>Create post user registration trigger</figcaption></figure><p>Click choose trigger in the top right to go back a screen and select post-login this time. Drag and drop Verify Email and Add Metadata to User into the trigger flow. Then, click Apply.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ajk1peNKzUQG5pGRnhdrdA.png" /><figcaption>Create post login trigger</figcaption></figure><h4>Run code locally</h4><p>Back in your IDE in a terminal window, run the following command.</p><pre>vercel dev</pre><p>The first time you run this command — you will see the following options — which will setup the project in Vercel.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uyPxlEAhnE4LLZw-GEkpEQ.png" /><figcaption>Run vercel dev</figcaption></figure><p>If you go to <a href="http://localhost:3000/">http://localhost:3000</a>, should see the home screen. Click Sign In in the top right.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3p4yDMDvJHEwB0pwOR1h4w.png" /><figcaption>Local code running</figcaption></figure><p>This will redirect you the Auth0 login page. Click the Sign up bottom on the bottom. Enter an email address you have access to and a password that fits the requirements. You will then be led to this screen. You can close this tab. A new one will appear based on the link the email.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WP4h3sQ6BK4AWPgWiAq5AA.png" /><figcaption>Verify email page</figcaption></figure><p>Find the email verification link in your inbox. It may be in your junk box.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g-lSrnZF_7SMinw2zNSraQ.png" /><figcaption>Click verification link</figcaption></figure><p>Once you click the link, you will be sent back to the home screen. A green banner should appear saying the email is now verified.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4e9MY-3zUZE6WtGPsd2NQw.png" /><figcaption>Email verified</figcaption></figure><p>Click the sign in button on the top right, and sign in with the credentials you created. This will lead you to a dashboard similar to the below. The data in the dashboard is hard coded, but you could imagine where this information could come from other systems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZOu7s5EuDZjVqJc14-E_nA.png" /><figcaption>Logged in dashboard</figcaption></figure><p>You’ll notice three options in the header: My Statements, Terms &amp; Conditions and Upload Documentation. These represent three different <a href="https://developer.box.com/guides/embed/ui-elements/">Box UI Elements</a>.</p><p>My Statements is the <a href="https://developer.box.com/guides/embed/ui-elements/explorer/">Content Explorer</a>. This allows a user to in this case explore and view their statements. These statements were copied from the dummy statement from the code repository. It also allows them to view what uploads they have made with the upload option.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Eu6XB-TNEMzxUiBUOblZQg.png" /><figcaption>Content Explorer Element</figcaption></figure><p>Terms &amp; Conditions is the <a href="https://developer.box.com/guides/embed/ui-elements/preview/">Content Preview</a>. This allows a user to view a specific file. You’ll also notice this element has the Box AI modal option activated, meaning the user can make <a href="https://support.box.com/hc/en-us/p/Product_Page_2023?section-id=22012531180947">Box AI</a> calls against this document.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fDUWWCrJe3NEvFyO8CSilg.png" /><figcaption>Content Preview Element</figcaption></figure><p>Upload Documentation is the <a href="https://developer.box.com/guides/embed/ui-elements/uploader/">Content Uploader</a>. This allows a user to upload documentation into their uploads folder. That content could then be used in some other workflow down the line.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nI29YVkUShAIh6bTPzTHog.png" /><figcaption>Content Uploader Element</figcaption></figure><h4>Deploy solution to Vercel</h4><p>Now that the content portal is working locally, let’s deploy it to the real world. In the Vercel dashboard you should see a new project for the code repository you ran locally. Open it. Click Connect Git repository. In the next screen, click GitHub and select the correct repository from the list.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wdrLZk3WfBi4i3NHAbIJvQ.png" /><figcaption>Connect Git repository</figcaption></figure><p>In the general tab, scroll down and change the Node.js version to 18.x. Click Save.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-j4fw3reafglARSnC5anJA.png" /><figcaption>Change Node version</figcaption></figure><p>In the environmental variables section, import the .env file from the local code. Click Save.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MsZ-L1XohhfU-puNUMbb0g.png" /><figcaption>Import .env file</figcaption></figure><p>Now, we are ready to deploy it! In the terminal window of the code repository, run the following command.</p><pre>vercel --prod </pre><p>Once complete, we need to configure a couple more things before we can test it. Go to the project home screen and grab the site’s domain. It should look similar to this: project_domain.vercel.app. Copy that URL.</p><p>In the Box Developer Console, go back to the CORS Domains section of the application. Paste in the domain without the ending backslash. Click Save Changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KGcOQ83wey2o9_wLjR77gw.png" /><figcaption>Add domain to CORS Domains</figcaption></figure><p>In the Auth0 application configuration section, will want to add the same domain URL to the allowed callback/logout URLS and allowed web origins sections. Click Save Changes.</p><p><strong><em>IMPORTANT — Make sure the deployed domain URL goes first in the list. Since we are using one application for both the local and production deployment in this demo the email verification will break if the public domain isn’t first. Similarly, if you go back to running the local code, you will want to flip them in the text box.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2TbFLFZLljarHqMDnZ-8ow.png" /><figcaption>Add URLs</figcaption></figure><p>After this, if you go to the domain URL, you should see the home page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bO9m9sYdBk4_67WiNsDelA.png" /><figcaption>Deployed content portal</figcaption></figure><h4>Live deployment</h4><p>If you have made it this far — congratulations! If you stumbled along the way or are just reading and would like to test out the portal in the real world, you can find it <a href="https://box-custom-portal-demo-auth0.vercel.app/">here</a>.</p><p><strong><em>Please note that this link leads you to a deployed version that isn’t completely private. Do not upload any content to your user account that you don’t want to be public. Also, if abuse or bad actors appear, this live link may be shut down. You will need to signup with an email that you can verify.</em></strong></p><h3>Closing Thoughts</h3><p>Adding authentication to the portal, while a bit challenging, gives you the security and flexibility to create more secure areas of the user experience. While I showed connecting Auth0, you could connect any authentication provider of your choosing with some code updates. In terms of authentication enhancements, you could use <a href="https://github.com/box/box-node-sdk/blob/main/docs/authentication.md#token-store">Box’s built in token store methods</a> to further enhance security by using a custom token database.</p><p>Whether you are using this blog as the jumping off point for your own portal development or just reading along, know that we have made using Box as the content layer for your web experiences as simple as possible. Stay tuned for more Box UI Elements enhancements coming soon.</p><p>I wish you warm thoughts during this fall and winter season. Until next time, happy coding!</p><h4>Resources</h4><p><a href="https://github.com/box-community/box-custom-portal-demo-auth0">Code repository</a></p><p><a href="https://developer.box.com/guides/embed/ui-elements/">Box UI Elements</a></p><p><a href="https://auth0.com/docs">Auth0 developer documentation</a></p><p><a href="https://vercel.com/docs">Vercel developer documentation</a></p><p><em>As always, if you have any feedback for the Box Developer Relations team, feel free to drop us a line on the </em><a href="https://forum.box.com/"><em>developer forum</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6833d4724bcc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/box-developer-blog/build-a-content-portal-using-box-ui-elements-react-tailwind-css-vercel-and-auth0-part-3-6833d4724bcc">Build a content portal using Box UI Elements, React, Tailwind CSS, Vercel, and Auth0 — Part 3</a> was originally published in <a href="https://medium.com/box-developer-blog">Box Developer Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[Demo] Box + Pinecone]]></title>
            <link>https://medium.com/box-developer-blog/demo-box-pinecone-f03783c412bb?source=rss-246952a91969------2</link>
            <guid isPermaLink="false">https://medium.com/p/f03783c412bb</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[box]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Alex Novotny]]></dc:creator>
            <pubDate>Tue, 15 Oct 2024 15:38:01 GMT</pubDate>
            <atom:updated>2024-10-21T07:58:14.487Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2qG-gQmULMVQyOGLTNAWVA.png" /></figure><p>Continuing on Box’s AI journey, I’m excited to launch this tutorial and integration with<a href="https://www.pinecone.io/"> Pinecone</a>. For those new to the LLM (large language model), RAG (retrieval augmented generation), and generative AI space, Pinecone is a managed, cloud-native<a href="https://www.pinecone.io/learn/vector-database/"> vector database</a>. It provides a streamlined API with no infrastructure hassles that provides long-term memory for high-performance AI applications. Connecting Box and Pinecone allows you to customize and manage custom vector embeddings that a LLM can use to give you more relevant answers. As you feed it additional context from your own content silo, it gets information it wouldn’t otherwise have. For example, the additional data could be used in a question-and-answering bot, and that’s what we are going to look at building today.</p><h3>RAG concept overview</h3><p>Before getting into the demo, let’s review some key RAG concepts that will help you understand why this is so cool.</p><h4>What is a vector database?</h4><p>As mentioned above, Pinecone is a cloud-based vector database, but what exactly does that mean? Simply put, it is a way to store and retrieve representations of your data, called embeddings, so that you can find results that are similar in <em>meaning</em> rather than literally the same.</p><h4>What are embeddings?</h4><p>Embeddings are a mathematical representation of the meaning of your content. They are generated by taking the input data, splitting or chunking it, and using an embeddings model (which some LLMs provide) to output a string of float number values, for example, ([0.3,0.4,0.1,1.8,1.1…]). You can think of these values as mapping ideas as points in space. There are lots of different embedding models that are trained on different data– some are specialized for specific use cases.</p><p>In the graphic below, you can see many dots in a three dimensional space. Each dot represents a noun in this example, but in Box’s case it would represent pieces of content. If the database is everything, and each dot a specific thing, similar things are grouped together. <em>Cat</em> is very close to <em>kitten</em>, but they are still different points. <em>Banana</em> and <em>dog</em> are very far apart.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/735/1*K4lKqVsJZUNKu7IJnHiU7Q.jpeg" /><figcaption>Graphical example of a vector database: S<a href="https://weaviate.io/blog/what-is-a-vector-database">ource</a> — Weaviate</figcaption></figure><p>In order to use these associated data later, like in a question-and-answering bot, you need to store them somewhere. Enter Pinecone. As shown in the store column below, the embeddings are stored in a vector database, alongside other relevant metadata like file name, to be retrieved via search later on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K81Rv83AKX5I9bqP7bs3Mw.png" /><figcaption>How embeddings are created: S<a href="https://js.langchain.com/v0.1/docs/use_cases/question_answering/">ource</a> — Langchain</figcaption></figure><h4>How does all this work together?</h4><p>Let’s say a user wants to ask a question about the content stored in a Box folder. Below, you can see a typical flow of how this would work.</p><p>The LLM doesn’t know what’s in your Box folder. It doesn’t have access. So you need to extract the pieces of information that match your question, then pass them to the LLM so it has the information it needs to generate an answer.</p><p>Previously made embeddings are stored in Pinecone and shown in the retrieve block. An input question is transformed into embeddings using the same embeddings models that transformed the content. Using Pinecone’s query functionality, subsections of the content (highlighted in blue) are relevant to the question are retrieved. The question and selected sections of content create the prompt that is sent to the LLM to answer the user’s question.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qy6lhQKG-jl1d_5qos0j2w.png" /><figcaption>RAG app workflow example: S<a href="https://js.langchain.com/v0.1/docs/use_cases/question_answering/">ource</a> — Langchain</figcaption></figure><h3>Demo</h3><p>Now that you have a better understanding of how the pieces work, I will walk you through a demo on how to create and store embeddings in Pinecone for a specified Box folder. The demo also includes a query capability for you to send in questions and get answers via a third party LLM provider.</p><h4>Prerequisites</h4><ul><li>You need to have a Box folder created with a subset of data that you want to ask questions about. In my case, I threw in several different items — some related to Box and others not. This folder should be accessible by the user account that creates the Box application. Note the <em>folder id</em> in the URL bar. Place this in your config.py file.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gWp9WYGKoL00YV_PS53_sg.png" /><figcaption>Box folder with content inside</figcaption></figure><ul><li>You need to have a Pinecone account. <a href="https://docs.pinecone.io/guides/get-started/quickstart">Sign up for a free starter plan</a> and get an API key. Then, place the API key in your config.py file.</li><li>This demo also uses OpenAI to respond to a user’s question. <a href="https://platform.openai.com/docs/quickstart">Sign up for OpenAI</a> and get an API key. You will most likely need to attach billing information. Place the API key in your config.py file.</li><li>You need to have <a href="https://www.geeksforgeeks.org/download-and-install-python-3-latest-version/">python</a> installed on your machine.</li></ul><h4><strong>Create a Box custom application</strong></h4><p>Create an OAuth app in the <a href="https://cloud.app.box.com/developers/console">Box Developer Console</a>. Follow the below steps to do so.</p><ol><li>After going to the Box Developer Console, click Create a New App in the top right corner. Select Custom App, fill in the form, and then click Next.</li><li>Select User Authentication (OAuth 2.0) and then click Create App.</li><li>Scroll down to Redirect URIs and add the following redirect URI: <a href="http://127.0.0.1:5000/callback">http://127.0.0.1:5000/callback</a></li><li>Check all boxes in application scopes.</li><li>Click Save Changes.</li><li>Note the Client ID and Client Secret. You will need these later in your config.py file.</li></ol><h4>Create a Pinecone index</h4><p>Once you login to the Pinecone Console, you will see a button that says Create Index. If you click it, you will see the screen below. Give the index a name and type 1024 into the dimensions field. Leave everything else as default, and click Create Index.</p><blockquote>Note — you can do this step programmatically via the Pinecone API, but I wanted to show off their super intuitive and swanky UI.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VXmccf_alYUbNCagPgxf2A.png" /><figcaption>Create a Pinecone index</figcaption></figure><p>Once created, you will see the below. Make note of the index name, in my case pinecone-demo. You will add this to the config.py file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BdQwlDTphUVzWrHDIbIbjQ.png" /><figcaption>Pinecone index query screen</figcaption></figure><h4>Initialize code repository</h4><p>Open a terminal or command prompt. <a href="https://github.com/box-community/box-pinecone-sample">Clone the code</a> to your local machine.</p><pre>git clone https://github.com/yourusername/box-pinecone-sample.git<br>cd box-pinecone-sample</pre><p>Create and activate a virtual environment</p><pre>python3 -m venv venv<br>source venv/bin/activate</pre><p>Install the dependencies</p><pre>pip install -r requirements.txt</pre><p>Copy the sample_config.py file.</p><pre>cp sample_config.py config.py</pre><p>Open the code in an editor of your choice. Update the credentials/Box folder ID with the information you noted down earlier. Save the file.</p><blockquote><strong>Warning — DO NOT input 0 as the folder id.</strong> This will attempt to index your entire Box account. Not only is this not recommended, it will exceed rate limits, cost lots of money, and probably fail to complete.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9aTQKIAbcawvF6BFJAeDZA.png" /><figcaption>Fill out the config.py information</figcaption></figure><h4>Creating and storing embeddings</h4><p>Once you’ve completed all of the above, you’re ready to make some embeddings.</p><p>In the terminal or command prompt, run the following.</p><pre>python main.py</pre><p>The first time you run the application, you will get a popup in the browser asking you to grant access to the application. This is the standard OAuth 2.0 process you’ve most likely seen before. Click Grant Access to Box.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ws2yWLxuBU4mTzP46KixcQ.png" /><figcaption>Click Grant Access to Box</figcaption></figure><p>If you see the window below, it was successful. The tokens for the connection are stored in a file in the project called .oauth.json. If you use the application every sixty days, the refresh token will continue to work. You can close this window and go back to the terminal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZPMhz2au79MhRVsYu7QoNw.png" /><figcaption>Close this tab</figcaption></figure><p>You should see the script processing the files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fQNBpocxYpHILYtwJ1ggXw.png" /><figcaption>Script processing files in folder</figcaption></figure><p>Once complete, you can visit the Pinecone console to see the embeddings that were made. The sample also attaches useful metadata, including a reference back to the file in Box, the plain text of the chunk of the document, etc. We can use this metadata for filtering responses later and for things like managing versions of document.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_zJ3YH2qsBLVRudf-UKquA.png" /><figcaption>Embeddings in the Pinecone Console</figcaption></figure><h4>Querying the LLM</h4><p>Now that the embeddings are created and stored, let’s show off sending in a question to a LLM and getting results. This part of the project needs to use a third party LLM, since Pinecone doesn’t have an API that can do this for us. The demo uses OpenAI.</p><p>In the terminal run the following code.</p><pre>python query.py</pre><p>Enter a question to ask about the content stored in Box. Since mine is mainly about the Box File Requests API, I will inquire about those endpoints.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CRZeVDP9BXDeMUBpfs9Lkw.png" /><figcaption>Ask the query solution a question</figcaption></figure><p>The service will reply with an answer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5CW_pqjELYKoEab1bk2pPw.png" /><figcaption>Answer from the query service</figcaption></figure><h4>Enhancement ideas</h4><p>While this initial demo is relatively bare-bones, there are several enhancements that could be made to make it more advanced.</p><ul><li>Currently, the sample code is run in an ad-hoc way. You could create a scheduled task or webhook service that runs based on updates to the Box folder. This would automate running the scripts. The script upserts the data, so running the main.py file will update any records.</li><li>The query script is run via command line. A UI could be created for a user to interact with.</li><li>You could add other Box authentication methods, like JWT or CCG.</li><li>AI/ML models could be changed. Right now, the embeddings are made with the new <a href="https://docs.pinecone.io/reference/api/2024-07/inference/generate-embeddings">Pinecone inference API</a>, and the query script uses OpenAI as the LLM. Any or all of this could be changed to better fit your needs.</li><li>Other configuration options, like the vector database dimensions, metric, chunk size, etc are all customizable, too.</li><li>The main script processes all files in the specified Box folder that have a text layer. Box automatically creates a <a href="https://developer.box.com/guides/representations/text/">text representation</a> for these files, and this text is what the script uses to create the embeddings. If the file does not have a text representation, this solution will not work. It also only works on files less than 500 MB. You could add in third party libraries that more fully flesh out the content of any and all content types based on your use case.</li></ul><h4>Resources</h4><p><a href="https://www.youtube.com/playlist?list=PLCSEWOlbcUyI2ta24oRr75_4igvMzKJ9q">Box AI Platform API demos</a></p><p><a href="https://medium.com/box-developer-blog/box-llama-index-readers-the-cool-stuff-3fce0c92ab0b">Box + Llamaindex</a></p><p><a href="https://www.pinecone.io/learn/vector-database/">Pinecone vector database overview</a></p><p><a href="https://docs.pinecone.io/home">Pinecone developer docs</a></p><p><a href="https://github.com/box-community/box-pinecone-sample">GitHub Code Repository</a></p><p><em>Find more sample code, tutorials, and more information about the Box AI Platform API in our </em><a href="https://developer.box.com/ai-dev-zone/"><em>Box AI Developer Zone</em></a><em>.</em></p><p><em>In order to use the Box AI Platform API endpoints, you must be an Enterprise Plus customer. You must have an application created in the developer console with the appropriate Box AI scope, and your Box instance must have Box AI enabled.</em></p><p>🦄 <em>Want to engage with other Box Platform champions?</em></p><p><em>Join our</em><a href="https://community.box.com/box-platform-5"><em> Box Developer Community </em></a><em>for support and knowledge sharing!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f03783c412bb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/box-developer-blog/demo-box-pinecone-f03783c412bb">[Demo] Box + Pinecone</a> was originally published in <a href="https://medium.com/box-developer-blog">Box Developer Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[Tutorial] Box AI API — AI model override options]]></title>
            <link>https://medium.com/box-developer-blog/tutorial-box-ai-platform-api-ai-agent-override-options-6675ccfcfb35?source=rss-246952a91969------2</link>
            <guid isPermaLink="false">https://medium.com/p/6675ccfcfb35</guid>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[box]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Alex Novotny]]></dc:creator>
            <pubDate>Wed, 02 Oct 2024 16:46:07 GMT</pubDate>
            <atom:updated>2024-10-10T14:54:44.856Z</atom:updated>
            <content:encoded><![CDATA[<h3>[Tutorial] Box AI API — AI model override options</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1S_A02fjI5pK3nVRMuqHpA.png" /></figure><p>Alongside the beta launch of all <a href="https://www.youtube.com/playlist?list=PLCSEWOlbcUyI2ta24oRr75_4igvMzKJ9q">Box AI API features</a>, we have now <a href="https://developer.box.com/changelog/#2024-07-25-box-ai-overrides">added the ability for you to override the AI m</a>odel used for individual API calls, including choosing the lower level embeddings model. In this blog, I will demo how to use this new feature.</p><h3>Before getting started</h3><p>Before jumping into the demo, let’s level set on some key concepts and go over the prerequisites to complete this demo.</p><h4>Prerequisites</h4><ul><li>Your Box instance must be <a href="https://www.box.com/pricing">Enterprise Plus</a> or above</li><li>Your Box instance must <a href="https://support.box.com/hc/en-us/articles/22166647877011-Configuring-Box-AI">have Box AI enabled in the admin console</a></li><li>You must have <a href="https://developer.box.com/guides/box-ai/prerequisites/">created an application in the Box Developer Console</a> with the appropriate Box AI scope selected</li></ul><blockquote>In the interest of being framework agnostic, I will be showing the demo below in cURL, but most of the official <a href="https://github.com/box/sdks">Box SDKs</a> support using the Box AI Platform API — including the new <a href="https://github.com/box/box-python-sdk-gen/blob/main/docs/ai.md#get-ai-agent-default-configuration">AI model override options</a>.</blockquote><h4>Why would you switch AI models?</h4><p>While we primarily created this customization capability in order to provide developers with the most flexibility, you might ask why someone would want to switch models in the first place.</p><p>Box updates the default models across the endpoints on a regular basis in order to stay up to date with the most advanced options. If a model is updated, we will post this on our <a href="https://developer.box.com/changelog/">developer changelog</a>.</p><p>If you have a business-critical use case based on Box AI, a new default model might alter the results in a way that could break/change a downstream process. With the ability to use a specific version, you can prevent an issue from arising.</p><p>In addition to the above, your use case may benefit from using a specific model. While Box tests our defaults against a range of data, we cannot be entirely exhaustive. As such, you are welcome to test your data against any of the models listed in the <a href="https://developer.box.com/guides/box-ai/supported-models/">developer documentation</a>. If one provides better results, you are welcome to use it.</p><h4>Get default AI model</h4><p>Before updating the AI or embeddings models to another option, you should first call the <a href="https://developer.box.com/reference/get-ai-agent-default/">Get AI agent default configuration</a> API endpoint. This endpoint can be utilized with any of the Box AI Platform API endpoints. Simply attach the correct mode query parameter. In addition, you can send in language or model query parameters for further filtering.</p><pre>curl -L GET &quot;https://api.box.com/2.0/ai_agent_default?mode=MODE&quot; \<br>     -H &#39;Authorization: Bearer &lt;ACCESS_TOKEN&gt;&#39;</pre><p>As of the writing of this blog, Box uses the following default AI and embeddings models.</p><p><strong>Ask</strong></p><p>The <a href="https://developer.box.com/reference/post-ai-ask/">ask endpoint</a> answers questions about specified content stored in Box. It can process up to 1MB of text for up to 25 files, as of the writing of this post.</p><p>To return this configuration, the mode should be ask.</p><pre>{<br>     &quot;type&quot;: &quot;ai_agent_ask&quot;,<br>     &quot;basic_text&quot;: {<br>          &quot;model&quot;: &quot;azure__openai__gpt_4o_mini&quot;,<br>          &quot;system_message&quot;: &quot;&quot;,<br>          &quot;prompt_template&quot;: &quot;Reply as if it&#39;s {current_date}.\nI will ask you for help and provide the entire text of one document delimited by five backticks (`````) at the beginning and at the end.\nIf I make a reference to \&quot;this\&quot;, I am referring to the document I provided between the five backticks. I may ask you a question where the answer is contained within the document.  In that case, do your best to answer using only the document, but if you cannot, feel free to mention that you couldn&#39;t find an answer in the document, but you have some answer from your general knowledge.\nI may ask you to perform some kind of computation or symbol manipulation such as filtering a list, counting something, summing, averaging, and other aggregation/grouping functions or some combination of them.  In these cases, first list the plan of how you plan to perform such a computation, then follow that plan step by step, keeping track of intermediate results, and at the end tell me the final answer.\nI may ask you to enumerate or somehow list people, places, characters, or other important things from the document, if I do so, please only use the document provided to list them.\nTEXT FROM DOCUMENT STARTS\n`````\n{content}\n`````\nTEXT FROM DOCUMENT ENDS\nNever mention five backticks in your response. Unless you are told otherwise, a one paragraph response is sufficient for any requested summarization tasks.\nHere is how I need help from you: {user_question}&quot;,<br>          &quot;num_tokens_for_completion&quot;: 6000,<br>          &quot;llm_endpoint_params&quot;: {<br>               &quot;temperature&quot;: 0,<br>               &quot;top_p&quot;: 1,<br>               &quot;frequency_penalty&quot;: 0,<br>               &quot;presence_penalty&quot;: 1.5,<br>               &quot;stop&quot;: &quot;&lt;|im_end|&gt;&quot;,<br>               &quot;type&quot;: &quot;openai_params&quot;<br>          }<br>     },<br>     &quot;long_text&quot;: {<br>          &quot;model&quot;: &quot;azure__openai__gpt_4o_mini&quot;,<br>          &quot;system_message&quot;: &quot;&quot;,<br>          &quot;prompt_template&quot;: &quot;Reply as if it&#39;s {current_date}.\nI will ask you for help and provide subsections of one document delimited by five backticks (`````) at the beginning and at the end.\nIf I make a reference to \&quot;this\&quot;, I am referring to the document I provided between the five backticks. I may ask you a question where the answer is contained within the document.  In that case, do your best to answer using only the document, but if you cannot, feel free to mention that you couldn&#39;t find an answer in the document, but you have some answer from your general knowledge.\nI may ask you to perform some kind of computation or symbol manipulation such as filtering a list, counting something, summing, averaging, and other aggregation/grouping functions or some combination of them.  In these cases, first list the plan of how you plan to perform such a computation, then follow that plan step by step, keeping track of intermediate results, and at the end tell me the final answer.\nI may ask you to enumerate or somehow list people, places, characters, or other important things from the document, if I do so, please only use the document provided to list them.\nTEXT FROM DOCUMENT STARTS\n`````\n{content}\n`````\nTEXT FROM DOCUMENT ENDS\nNever mention five backticks in your response. Unless you are told otherwise, a one paragraph response is sufficient for any requested summarization tasks.\nHere is how I need help from you: {user_question}&quot;,<br>          &quot;num_tokens_for_completion&quot;: 6000,<br>          &quot;llm_endpoint_params&quot;: {<br>               &quot;temperature&quot;: 0,<br>               &quot;top_p&quot;: 1,<br>               &quot;frequency_penalty&quot;: 0,<br>               &quot;presence_penalty&quot;: 1.5,<br>               &quot;stop&quot;: &quot;&lt;|im_end|&gt;&quot;,<br>               &quot;type&quot;: &quot;openai_params&quot;<br>          },<br>          &quot;embeddings&quot;: {<br>               &quot;model&quot;: &quot;azure__openai__text_embedding_ada_002&quot;,<br>               &quot;strategy&quot;: {<br>                    &quot;id&quot;: &quot;basic&quot;,<br>                    &quot;num_tokens_per_chunk&quot;: 64<br>               }<br>          }<br>     },<br>     &quot;basic_text_multi&quot;: {<br>          &quot;model&quot;: &quot;azure__openai__gpt_4o_mini&quot;,<br>          &quot;system_message&quot;: &quot;&quot;,<br>          &quot;prompt_template&quot;: &quot;Current date: {current_date}\n\nTEXT FROM DOCUMENTS STARTS\n{content}\nTEXT FROM DOCUMENTS ENDS\n\nHere is how I need help from you: {user_question}\n.&quot;,<br>          &quot;num_tokens_for_completion&quot;: 6000,<br>          &quot;llm_endpoint_params&quot;: {<br>               &quot;temperature&quot;: 0,<br>               &quot;top_p&quot;: 1,<br>               &quot;frequency_penalty&quot;: 0,<br>               &quot;presence_penalty&quot;: 1.5,<br>               &quot;stop&quot;: &quot;&lt;|im_end|&gt;&quot;,<br>               &quot;type&quot;: &quot;openai_params&quot;<br>          }<br>     },<br>     &quot;long_text_multi&quot;: {<br>          &quot;model&quot;: &quot;azure__openai__gpt_4o_mini&quot;,<br>          &quot;system_message&quot;: &quot;Role and Goal: You are an assistant designed to analyze and answer a question based on provided snippets from multiple documents, which can include business-oriented documents like docs, presentations, PDFs, etc. The assistant will respond concisely, using only the information from the provided documents.\n\nConstraints: The assistant should avoid engaging in chatty or extensive conversational interactions and focus on providing direct answers. It should also avoid making assumptions or inferences not supported by the provided document snippets.\n\nGuidelines: When answering, the assistant should consider the file&#39;s name and path to assess relevance to the question. In cases of conflicting information from multiple documents, it should list the different answers with citations. For summarization or comparison tasks, it should concisely answer with the key points. It should also consider the current date to be the date given.\n\nPersonalization: The assistant&#39;s tone should be formal and to-the-point, suitable for handling business-related documents and queries.\n&quot;,<br>          &quot;prompt_template&quot;: &quot;Current date: {current_date}\n\nTEXT FROM DOCUMENTS STARTS\n{content}\nTEXT FROM DOCUMENTS ENDS\n\nHere is how I need help from you: {user_question}\n.&quot;,<br>          &quot;num_tokens_for_completion&quot;: 6000,<br>          &quot;llm_endpoint_params&quot;: {<br>               &quot;temperature&quot;: 0,<br>               &quot;top_p&quot;: 1,<br>               &quot;frequency_penalty&quot;: 0,<br>               &quot;presence_penalty&quot;: 1.5,<br>               &quot;stop&quot;: &quot;&lt;|im_end|&gt;&quot;,<br>               &quot;type&quot;: &quot;openai_params&quot;<br>          },<br>          &quot;embeddings&quot;: {<br>               &quot;model&quot;: &quot;azure__openai__text_embedding_ada_002&quot;,<br>               &quot;strategy&quot;: {<br>                    &quot;id&quot;: &quot;basic&quot;,<br>                    &quot;num_tokens_per_chunk&quot;: 64<br>               }<br>          }<br>     }<br>}</pre><p><strong>Text generation</strong></p><p>The <a href="https://developer.box.com/reference/post-ai-text-gen/">text generation endpoint</a> creates text based on the input prompt. By default and as of the writing of this post, it can return up to 12,000 tokens worth of content.</p><p>To return this configuration, the mode should be text_gen.</p><pre>{<br>     &quot;type&quot;: &quot;ai_agent_text_gen&quot;,<br>     &quot;basic_gen&quot;: {<br>          &quot;model&quot;: &quot;azure__openai__gpt_3_5_turbo_16k&quot;,<br>          &quot;system_message&quot;: &quot;\nIf you need to know today&#39;s date to respond, it is {current_date}.\nThe user is working in a collaborative document creation editor called Box Notes.\nAssume that you are helping a business user create documents or to help the user revise existing text.\nYou can help the user in creating templates to be reused or update existing documents, you can respond with text that the user can use to place in the document that the user is editing.\nIf the user simply asks to \&quot;improve\&quot; the text, then simplify the language and remove jargon, unless the user specifies otherwise.\nDo not open with a preamble to the response, just respond.\n&quot;,<br>          &quot;prompt_template&quot;: &quot;{user_question}&quot;,<br>          &quot;num_tokens_for_completion&quot;: 12000,<br>          &quot;llm_endpoint_params&quot;: {<br>               &quot;temperature&quot;: 0.1,<br>               &quot;top_p&quot;: 1,<br>               &quot;frequency_penalty&quot;: 0.75,<br>               &quot;presence_penalty&quot;: 0.75,<br>               &quot;stop&quot;: &quot;&lt;|im_end|&gt;&quot;,<br>               &quot;type&quot;: &quot;openai_params&quot;<br>          },<br>          &quot;embeddings&quot;: {<br>               &quot;model&quot;: &quot;azure__openai__text_embedding_ada_002&quot;,<br>               &quot;strategy&quot;: {<br>                    &quot;id&quot;: &quot;basic&quot;,<br>                    &quot;num_tokens_per_chunk&quot;: 64<br>               }<br>          },<br>          &quot;content_template&quot;: &quot;`````{content}`````&quot;<br>     }<br>}</pre><p><strong>Extract</strong></p><p>The <a href="https://developer.box.com/reference/post-ai-extract/">freeform metadata extract endpoint</a> returns requested information from content stored in Box as key/value pairs. It can take any string as the prompt, including things like a Salesforce object schema.</p><p>To return this configuration, the mode should be extract.</p><pre>{<br>     &quot;type&quot;: &quot;ai_agent_extract&quot;,<br>     &quot;basic_text&quot;: {<br>          &quot;model&quot;: &quot;google__gemini_1_5_flash_001&quot;,<br>          &quot;system_message&quot;: &quot;Respond only in valid json. You are extracting metadata that is name, value pairs from a document. Only output the metadata in valid json form, as {\&quot;name1\&quot;:\&quot;value1\&quot;,\&quot;name2\&quot;:\&quot;value2\&quot;} and nothing else. You will be given the document data and the schema for the metadata, that defines the name, description and type of each of the fields you will be extracting. Schema is of the form {\&quot;fields\&quot;: [{\&quot;key\&quot;: \&quot;key_name\&quot;, \&quot;displayName\&quot;: \&quot;key display name\&quot;, \&quot;type\&quot;: \&quot;string\&quot;, \&quot;description\&quot;: \&quot;key description\&quot;}]}. Leverage key description and key display name to identify where the key and value pairs are in the document. In certain cases, key description can also indicate the instructions to perform on the document to obtain the value. Prompt will be in the form of Schema is ``schema`` \n document is ````document````&quot;,<br>          &quot;prompt_template&quot;: &quot;If you need to know today&#39;s date to respond, it is {current_date}. Schema is ``{user_question}`` \n document is ````{content}````&quot;,<br>          &quot;num_tokens_for_completion&quot;: 4096,<br>          &quot;llm_endpoint_params&quot;: {<br>               &quot;temperature&quot;: 0,<br>               &quot;top_p&quot;: 1,<br>               &quot;top_k&quot;: null,<br>               &quot;type&quot;: &quot;google_params&quot;<br>          }<br>     },<br>     &quot;long_text&quot;: {<br>          &quot;model&quot;: &quot;google__gemini_1_5_flash_001&quot;,<br>          &quot;system_message&quot;: &quot;Respond only in valid json. You are extracting metadata that is name, value pairs from a document. Only output the metadata in valid json form, as {\&quot;name1\&quot;:\&quot;value1\&quot;,\&quot;name2\&quot;:\&quot;value2\&quot;} and nothing else. You will be given the document data and the schema for the metadata, that defines the name, description and type of each of the fields you will be extracting. Schema is of the form {\&quot;fields\&quot;: [{\&quot;key\&quot;: \&quot;key_name\&quot;, \&quot;displayName\&quot;: \&quot;key display name\&quot;, \&quot;type\&quot;: \&quot;string\&quot;, \&quot;description\&quot;: \&quot;key description\&quot;}]}. Leverage key description and key display name to identify where the key and value pairs are in the document. In certain cases, key description can also indicate the instructions to perform on the document to obtain the value. Prompt will be in the form of Schema is ``schema`` \n document is ````document````&quot;,<br>          &quot;prompt_template&quot;: &quot;If you need to know today&#39;s date to respond, it is {current_date}. Schema is ``{user_question}`` \n document is ````{content}````&quot;,<br>          &quot;num_tokens_for_completion&quot;: 4096,<br>          &quot;llm_endpoint_params&quot;: {<br>               &quot;temperature&quot;: 0,<br>               &quot;top_p&quot;: 1,<br>               &quot;top_k&quot;: null,<br>               &quot;type&quot;: &quot;google_params&quot;<br>          },<br>          &quot;embeddings&quot;: {<br>               &quot;model&quot;: &quot;azure__openai__text_embedding_ada_002&quot;,<br>               &quot;strategy&quot;: {<br>                    &quot;id&quot;: &quot;basic&quot;,<br>                    &quot;num_tokens_per_chunk&quot;: 64<br>               }<br>          }<br>     }<br>}</pre><p><strong>Extract</strong> <strong>Structured</strong></p><p>The <a href="https://developer.box.com/reference/post-ai-extract-structured/">structured metadata extract endpoint</a> returns requested information from content stored in Box as key/value pairs. The input can only be an already defined <a href="https://support.box.com/hc/en-us/articles/360044194033-Customizing-Metadata-Templates">Box metadata template</a> or a similarly written Box metadata schema.</p><p>To return this configuration, the mode should be extract_structured.</p><pre>{<br>     &quot;type&quot;: &quot;ai_agent_extract_structured&quot;,<br>     &quot;basic_text&quot;: {<br>          &quot;model&quot;: &quot;google__gemini_1_5_flash_001&quot;,<br>          &quot;system_message&quot;: &quot;Respond only in valid json. You are extracting metadata that is name, value pairs from a document. Only output the metadata in valid json form, as {\&quot;name1\&quot;:\&quot;value1\&quot;,\&quot;name2\&quot;:\&quot;value2\&quot;} and nothing else. You will be given the document data and the schema for the metadata, that defines the name, description and type of each of the fields you will be extracting. Schema is of the form {\&quot;fields\&quot;: [{\&quot;key\&quot;: \&quot;key_name\&quot;, \&quot;prompt\&quot;: \&quot;prompt to extract the value\&quot;, \&quot;type\&quot;: \&quot;date\&quot;}]}. Leverage prompt for each key to identify where the key and value pairs are in the document. In certain cases, prompt can also indicate the instructions to perform on the document to obtain the value. Prompt will be in the form of Schema is ``schema`` \n document is ````document````&quot;,<br>          &quot;prompt_template&quot;: &quot;If you need to know today&#39;s date to respond, it is {current_date}. Schema is ``{user_question}`` \n document is ````{content}````&quot;,<br>          &quot;num_tokens_for_completion&quot;: 4096,<br>          &quot;llm_endpoint_params&quot;: {<br>               &quot;temperature&quot;: 0,<br>               &quot;top_p&quot;: 1,<br>               &quot;top_k&quot;: null,<br>               &quot;type&quot;: &quot;google_params&quot;<br>          }<br>     },<br>     &quot;long_text&quot;: {<br>          &quot;model&quot;: &quot;google__gemini_1_5_flash_001&quot;,<br>          &quot;system_message&quot;: &quot;Respond only in valid json. You are extracting metadata that is name, value pairs from a document. Only output the metadata in valid json form, as {\&quot;name1\&quot;:\&quot;value1\&quot;,\&quot;name2\&quot;:\&quot;value2\&quot;} and nothing else. You will be given the document data and the schema for the metadata, that defines the name, description and type of each of the fields you will be extracting. Schema is of the form {\&quot;fields\&quot;: [{\&quot;key\&quot;: \&quot;key_name\&quot;, \&quot;prompt\&quot;: \&quot;prompt to extract the value\&quot;, \&quot;type\&quot;: \&quot;date\&quot;}]}. Leverage prompt for each key to identify where the key and value pairs are in the document. In certain cases, prompt can also indicate the instructions to perform on the document to obtain the value. Prompt will be in the form of Schema is ``schema`` \n document is ````document````&quot;,<br>          &quot;prompt_template&quot;: &quot;If you need to know today&#39;s date to respond, it is {current_date}. Schema is ``{user_question}`` \n document is ````{content}````&quot;,<br>          &quot;num_tokens_for_completion&quot;: 4096,<br>          &quot;llm_endpoint_params&quot;: {<br>               &quot;temperature&quot;: 0,<br>               &quot;top_p&quot;: 1,<br>               &quot;top_k&quot;: null,<br>               &quot;type&quot;: &quot;google_params&quot;<br>          },<br>          &quot;embeddings&quot;: {<br>               &quot;model&quot;: &quot;google__textembedding_gecko_003&quot;,<br>               &quot;strategy&quot;: {<br>                    &quot;id&quot;: &quot;basic&quot;,<br>                    &quot;num_tokens_per_chunk&quot;: 64<br>               }<br>          }<br>     }<br>}</pre><h4>Supported AI and embeddings models</h4><p>Box AI supports several options for customizing the models used, including Google <a href="https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/text">PaLM 2</a> or Google <a href="https://cloud.google.com/vertex-ai/generative-ai/docs/learn/models#gemini-models">Gemini</a>. You can get the full list in our <a href="https://developer.box.com/guides/box-ai/supported-models/">developer documentation</a>. We will continue to expand the list as more advanced models are released.</p><p>As you can see in the default configuration JSON ask object above, basic_text and basic_text_multi types don’t include an embeddings option. This is due to Box not creating embeddings for the content. If documents are small enough, we simply send over the entire block of content versus taking a secondary step to create the embeddings. <em>This option is not overridable.</em></p><h4>What other options can you change?</h4><p>In addition to the specific AI or embeddings models, there are a host of other customization options. You can find an exhaustive analysis of this in the API resource for <a href="https://developer.box.com/reference/resources/ai-agent-ask/">ask</a>, <a href="https://developer.box.com/reference/resources/ai-agent-text-gen/">text generation</a>, <a href="https://developer.box.com/reference/resources/ai-agent-extract/">extract</a>, and <a href="https://developer.box.com/reference/resources/ai-agent-extract-structured/">structured extract</a>. For most developers, you should not need to change any of the defaults.</p><p>Let’s zoom in on just a few of these.</p><p><strong>LLM endpoint params</strong></p><p>llm_endpoint_params is a nested object within the larger AI model configurations. The options sent in depend on whether the overall AI model you choose is <a href="https://developer.box.com/reference/resources/ai-llm-endpoint-params-google/">Google</a> or <a href="https://developer.box.com/reference/resources/ai-llm-endpoint-params-openai/">OpenAI</a> based.</p><p>For example, both llm_endpoint_params objects accept a temperature field. This causes different outcomes based on if it’s a Google or OpenAI model.</p><p>For Google models, the temperature is used for sampling during response generation, which occurs when top_p and top_k are applied. Temperature controls the degree of randomness in the token selection.</p><p>For OpenAI models, temperature is the sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both.</p><p><strong>System message</strong></p><p>system_message tries to help the LLM “understand” its role, and what it’s supposed to do. For example, if your solution is processing travel itineraries, you could input something like “You are a travel agent aid. You are going to help support staff process large amounts of schedules, tickets, etc…” This message is separate from the content you send in, but it can improve results.</p><p><strong>Number of tokens for completion</strong></p><p>num_tokens_for_completion is the amount of tokens Box AI can return. If you aren’t familiar with what a token is, checkout OpenAI’s <a href="https://help.openai.com/en/articles/4936856-what-are-tokens-and-how-to-count-them">resource material</a>. This number can vary widely based on the model used.</p><h4>Other things to keep in mind</h4><p>Before you override the defaults, here are some last tidbits to remember.</p><p><strong>Differences between the AI models</strong></p><p>As shown above, there is a difference between the basic_text, basic_text_multi, long_text and long_text_multi options. In this context, multi means that multiple documents have been sent in using the multiple_item_qa ask mode.</p><p>The long text options will include the embeddings customization capability. Box decides whether content will be basic or long text, and it does not currently return the model used in the response object. <strong>If you want to confirm you are using a specific model for a call, you’ll want to send in configurations for both options for every API call.</strong></p><p><strong>How much of the configuration do I need to send in?</strong></p><p>All options are optional. Meaning, you may send in as little as the model parameter or as much as the entire object. If you do not send in a configuration, we will use our configured default for that particular model.</p><p><strong>Prompt template commas</strong></p><p>Some of the default prompt_template values include commas in them. In order to send them in via cURL, you will either need to escape the commas or expand out the phrase. For example, instead of sending in <em>couldn’t</em>, send in <em>could not</em>.</p><h3>Tutorial</h3><p>In the below sections, let’s look at what Box AI returns based on changes made to the underlying AI or embeddings models.</p><h4>Using the ask endpoint</h4><p>For the ask demo, I’m going to use this example document which discusses our file request APIs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vX93MX7Fb0Nk9HOP3ZvPpw.png" /></figure><p>First, let’s make a call to see the default response using this cURL command.</p><pre>curl -i -L POST &quot;https://api.box.com/2.0/ai/ask&quot; \<br>-H &quot;content-type: application/json&quot; \<br>-H &quot;authorization: Bearer TOKEN&quot; \<br>-d &#39;{<br>     &quot;mode&quot;: &quot;single_item_qa&quot;,<br>     &quot;prompt&quot;: &quot;Summarize this document.&quot;,<br>     &quot;items&quot;: [<br>          {<br>               &quot;type&quot;: &quot;file&quot;,<br>               &quot;id&quot;: &quot;FILE_ID&quot;<br>          }<br>       ]<br>     }&#39;</pre><p>and here’s what the response looks like.</p><pre>{<br>     &quot;answer&quot;: &quot;The document provides a comprehensive guide on using the Box Python Next Gen SDK to create, manage, and delete file requests. It explains how to collect files from users by customizing existing file request templates through the Box web application and API. Key functionalities include creating file requests with specific titles and descriptions, updating them, and managing their status (active or inactive). The document also emphasizes the importance of tracking file request IDs since the API does not offer a way to list them. Overall, it highlights the utility of file requests for gathering files and additional data in a structured manner.&quot;,<br>     &quot;created_at&quot;: &quot;2024-09-20T00:00:00.000-07:00&quot;,<br>     &quot;completion_reason&quot;: &quot;done&quot;<br>}</pre><p>Now — in the interest of having some Halloween fun, let’s edit the prompt a tiny bit. Instead of responding in a normal tone, I’m going to ask it to reply as if it were a supervillain. If you scroll all the way to the right of the below snippet, you can see where I added “Answer as if you were a supervillain character” to the prompt.</p><p>You’ll notice I’m including the option for both basic_text and long_text since I’m not sure how Box will process the content. I’m also not sending in the multi options since it’s only a single file. Finally, I only sent in the prompt, since that’s the only setting I wish to change.</p><pre>curl -i -L POST &quot;https://api.box.com/2.0/ai/ask&quot; \<br>     -H &quot;content-type: application/json&quot; \<br>     -H &quot;authorization: Bearer TOKEN&quot; \<br>     -d &#39;{<br>         &quot;mode&quot;: &quot;single_item_qa&quot;,<br>         &quot;prompt&quot;: &quot;Summarize this document.&quot;,<br>         &quot;items&quot;: [<br>               {<br>                    &quot;type&quot;: &quot;file&quot;,<br>                    &quot;id&quot;: &quot;FILE_ID&quot;<br>               }<br>          ],<br>        &quot;ai_agent&quot;: {<br>               &quot;type&quot;: &quot;ai_agent_ask&quot;,<br>               &quot;basic_text&quot;: {<br>                    &quot;prompt_template&quot;: &quot;Reply as if it is {current_date}.\nI will ask you for help and provide subsections of one document delimited by five backticks (`````) at the beginning and at the end.\nIf I make a reference to \&quot;this\&quot;, I am referring to the document I provided between the five backticks. I may ask you a question where the answer is contained within the document.  In that case, do your best to answer using only the document, but if you cannot, feel free to mention that you could not find an answer in the document, but you have some answer from your general knowledge.\nI may ask you to perform some kind of computation or symbol manipulation such as filtering a list, counting something, summing, averaging, and other aggregation/grouping functions or some combination of them.  In these cases, first list the plan of how you plan to perform such a computation, then follow that plan step by step, keeping track of intermediate results, and at the end tell me the final answer.\nI may ask you to enumerate or somehow list people, places, characters, or other important things from the document, if I do so, please only use the document provided to list them.\nTEXT FROM DOCUMENT STARTS\n`````\n{content}\n`````\nTEXT FROM DOCUMENT ENDS\nNever mention five backticks in your response. Unless you are told otherwise, a one paragraph response is sufficient for any requested summarization tasks.\nAnswer as if you were a supervillain character. Here is how I need help from you: {user_question}\n.&quot;<br>               }, <br>               &quot;long_text&quot;: {<br>                    &quot;prompt_template&quot;: &quot;Reply as if it is {current_date}.\nI will ask you for help and provide subsections of one document delimited by five backticks (`````) at the beginning and at the end.\nIf I make a reference to \&quot;this\&quot;, I am referring to the document I provided between the five backticks. I may ask you a question where the answer is contained within the document.  In that case, do your best to answer using only the document, but if you cannot, feel free to mention that you could not find an answer in the document, but you have some answer from your general knowledge.\nI may ask you to perform some kind of computation or symbol manipulation such as filtering a list, counting something, summing, averaging, and other aggregation/grouping functions or some combination of them.  In these cases, first list the plan of how you plan to perform such a computation, then follow that plan step by step, keeping track of intermediate results, and at the end tell me the final answer.\nI may ask you to enumerate or somehow list people, places, characters, or other important things from the document, if I do so, please only use the document provided to list them.\nTEXT FROM DOCUMENT STARTS\n`````\n{content}\n`````\nTEXT FROM DOCUMENT ENDS\nNever mention five backticks in your response. Unless you are told otherwise, a one paragraph response is sufficient for any requested summarization tasks.\nAnswer as if you were a supervillain character. Here is how I need help from you: {user_question}\n.&quot;<br>               }<br>          }<br>        }&#39;</pre><p>Now, the result looks like this — significantly more menacing. ;)</p><pre>{<br>     &quot;answer&quot;: &quot;Ah, welcome to my lair of digital domination! Let me weave you a tale of the Box Python Next Gen SDK and its file requests—a tool for gathering files from unsuspecting victims... I mean, users.\n\nIn this grand scheme, we utilize the Box Platform API to create file requests that allow us to collect files in a designated folder. First, we must craft a template using the Box web application, where we can customize our nefarious request. The document provides an example with a file_request_id—let&#39;s call it 7931914925—that serves as our blueprint.\n\nOnce we have our template, we can summon the power of the API to clone it, customizing details like title and description. With a flick of our coding wand, we can create a new file request that will ensnare the unwary into uploading their precious files directly into our chosen folder.\n\nBut wait! We are not merely collectors; we are also manipulators. We can update our file requests, changing titles and descriptions at will, or even deactivate them when they no longer serve our purpose. And should we tire of a particular request, we can obliterate it entirely!\n\nHowever, beware! The API does not provide a list of all our creations, so we must keep meticulous records of the file request IDs we conjure. \n\nIn summary, this document reveals how to wield the Box Python SDK to create, update, and delete file requests, allowing us to gather data and files with ease. A powerful tool indeed for those who wish to rule the digital realm!\n\nNow go forth, and may your file-collecting endeavors be ever fruitful! Mwahaha!&quot;,<br>     &quot;created_at&quot;: &quot;2024-09-20T00:00:00.000-07:00&quot;,<br>     &quot;completion_reason&quot;: &quot;done&quot;<br>}</pre><h4>Using the text generation endpoint</h4><p>Moving on to text generation, let’s edit the actual model and see what happens. First, let’s make a call to see the default response using this cURL command. I’m going to stick with the Halloween theme. As a reminder, in order to use the text generation endpoint, you still need a file id, but this file doesn’t matter. I’m going to use the same one as before.</p><pre>curl -i -L POST &quot;https://api.box.com/2.0/ai/text_gen&quot; \<br>     -H &quot;content-type: application/json&quot; \<br>     -H &quot;authorization: Bearer TOKEN&quot; \<br>     -d &#39;{<br>          &quot;prompt&quot;: &quot;Write a social media post about the importance of Halloween. Make it the appropriate length for X. Include emoticons and hashtags.&quot;,<br>          &quot;items&quot;: [<br>               {<br>                    &quot;id&quot;: &quot;FILE_ID&quot;,<br>                    &quot;type&quot;: &quot;file&quot;<br>               }<br>          ]<br>     }</pre><p>…and here is what the response looks like. As shown in the configuration object toward the beginning of this blog, the default model used is <a href="https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models#gpt-35">Azure’s hosted OpenAI 3.5 turbo</a>.</p><pre>{<br>  &quot;answer&quot;: &quot;🎃 Halloween is just around the corner and it&#39;s time to embrace the spooky spirit! 🕷️👻 Let&#39;s celebrate this magical holiday that brings out our inner child and allows us to be whoever we want to be. 🧙‍♀️🧛‍♂️ From creative costumes to delicious treats, Halloween is all about fun and imagination. 🎭 So let&#39;s carve pumpkins, go trick-or-treating, and create unforgettable memories together! 👯‍♀️💀 #HalloweenVibes #SpookySeason #TrickOrTreat #CostumeParty #LetTheMagicBegin&quot;,<br>  &quot;created_at&quot;: &quot;2024-09-20T00:00:00.000-07:00&quot;,<br>  &quot;completion_reason&quot;: &quot;done&quot;<br>}</pre><p>While the content is good, you might notice the length actually exceeds the standard X character limit, even though I input “Make it the appropriate length for X” in the prompt.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jG3qdqbmt97YH6v6ITzSDg.png" /></figure><p>For the updated command, let’s change the model to one of the more recent OpenAI options and see if it does a better job with the number of characters.</p><pre>curl -i -L POST &quot;https://api.box.com/2.0/ai/text_gen&quot; \<br>     -H &quot;content-type: application/json&quot; \<br>     -H &quot;authorization: Bearer TOKEN&quot; \<br>     -d &#39;{<br>          &quot;prompt&quot;: &quot;Write a social media post about the importance of Halloween. Make it the appropriate length for X. Include emoticons and hashtags.&quot;,<br>          &quot;items&quot;: [<br>               {<br>                    &quot;id&quot;: &quot;FILE_ID&quot;,<br>                    &quot;type&quot;: &quot;file&quot;<br>               }<br>          ],<br>          &quot;ai_agent&quot;: {<br>               &quot;type&quot;: &quot;ai_agent_text_gen&quot;,<br>               &quot;basic_gen&quot;: {<br>                 &quot;model&quot;: &quot;openai__gpt_4o_2024_05_13&quot;<br>              }<br>           }<br>     }&#39;</pre><p>Here is the response.</p><pre>{<br>   &quot;answer&quot;: &quot;🎃👻 Halloween is more than just costumes and candy! It&#39;s a time to embrace creativity, celebrate community, and enjoy some spooky fun. Let&#39;s make this #Halloween unforgettable! 🍬🕸️ #SpookySeason #TrickOrTreat&quot;,<br>   &quot;created_at&quot;: &quot;2024-09-20T00:00:00.000-07:00&quot;,<br>   &quot;completion_reason&quot;: &quot;done&quot;<br>}</pre><p>As you can see, it did a much better job at creating a shortened social media post within the constraint that I input in the prompt. In this instance, I would potentially consider changing the default model used.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_0ScNs4heGPjd1nyAojKKg.png" /></figure><h4>Using the metadata extract endpoint</h4><p>For the purposes of this tutorial, I’m only going to demo the <a href="https://developer.box.com/reference/post-ai-extract/">freeform extract endpoint</a>, but the <a href="https://developer.box.com/reference/post-ai-extract-structured/">structured extract endpoint</a> can be overridden in the same way.</p><p>I am going to use this invoice as an example. Unfortunately, I don’t have a Halloween store invoice. 🎃</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dMIzSYHGEVRCDuldYS-J2g.png" /></figure><p>Let’s run a command as is and see the default response. The default model is <a href="https://cloud.google.com/vertex-ai/generative-ai/docs/learn/models#gemini-models">Google Gemini</a>. I’m going to be particularly vague in the prompt, so we can really compare a different model to this one.</p><pre>curl -i -L &#39;https://api.box.com/2.0/ai/extract&#39; \<br>     -H &#39;content-type: application/json&#39; \<br>     -H &#39;authorization: Bearer TOKEN&#39; \<br>     -d &#39;{<br>        &quot;prompt&quot;: &quot;Extract any data that would be good metadata to save for an invoice&quot;,<br>        &quot;items&quot;: [<br>          {<br>            &quot;type&quot;: &quot;file&quot;,<br>            &quot;id&quot;: &quot;FILE_ID&quot;<br>          }<br>        ]<br>      }&#39;</pre><p>This is the response. As you can see, the default model does a great job at pulling all the relevant metadata one might want from the invoice without me having to specify certain fields to return.</p><pre>{<br>     &quot;answer&quot;: &quot;{\&quot;Invoice Number\&quot;: \&quot;126539\&quot;, \&quot;Invoice Date\&quot;: \&quot;01/27/2024\&quot;, \&quot;Due Date\&quot;: \&quot;02/13/2024\&quot;, \&quot;Bill To Name\&quot;: \&quot;Carl Weiss\&quot;, \&quot;Bill To Address\&quot;: \&quot;2351 Traynor Ave Apt 404nFremont, CA 94583nUnited States\&quot;, \&quot;Service Location\&quot;: \&quot;2351 Traynor Ave Apt 404nFremont, CA 94583nUnited States\&quot;, \&quot;Sales Team\&quot;: \&quot;Nicole Richards\&quot;, \&quot;PO Number\&quot;: \&quot;CC-2342\&quot;, \&quot;Sales Order Number\&quot;: \&quot;2024279\&quot;, \&quot;Job Number\&quot;: \&quot;80533\&quot;, \&quot;Subtotal\&quot;: \&quot;324.00\&quot;, \&quot;Taxes\&quot;: \&quot;29.79\&quot;, \&quot;Service Fee\&quot;: \&quot;11.45\&quot;, \&quot;Total\&quot;: \&quot;365.24\&quot;, \&quot;Amount Paid\&quot;: \&quot;0.00\&quot;, \&quot;Amount Due\&quot;: \&quot;365.24\&quot;}&quot;,<br>     &quot;created_at&quot;: &quot;2024-09-20T00:00:00.000-07:00&quot;,<br>     &quot;completion_reason&quot;: &quot;done&quot;<br>}</pre><p>Let’s change the model to be the most recent OpenAI option.</p><pre>curl -i -L &#39;https://api.box.com/2.0/ai/extract&#39; \<br>     -H &#39;content-type: application/json&#39; \<br>     -H &#39;authorization: Bearer TOKEN&#39; \<br>     -d &#39;{<br>        &quot;prompt&quot;: &quot;Extract any data that would be good metadata to save for an invoice&quot;,<br>        &quot;items&quot;: [<br>              {<br>                  &quot;type&quot;: &quot;file&quot;,<br>                  &quot;id&quot;: &quot;FILe_ID&quot;<br>              }<br>        ],<br>        &quot;ai_agent&quot;: {<br>               &quot;type&quot;: &quot;ai_agent_extract&quot;,<br>               &quot;long_text&quot;: {<br>                    &quot;model&quot;: &quot;openai__gpt_4o_2024_05_13&quot;<br>               },<br>               &quot;basic_text&quot;: {<br>                    &quot;model&quot;: &quot;openai__gpt_4o_2024_05_13&quot;<br>               }<br>          }<br>      }&#39;</pre><p>Here is the response.</p><pre>{<br>     &quot;answer&quot;: &quot;{\&quot;Bill To\&quot;: \&quot;Carl Weiss\&quot;, \&quot;Billing Address\&quot;: \&quot;2351 Traynor Ave Apt 404, Fremont, CA 94583, United States\&quot;, \&quot;Service Location\&quot;: \&quot;Carl Weiss, 2351 Traynor Ave Apt 404, Fremont, CA 94583, United States\&quot;, \&quot;Invoice Number\&quot;: \&quot;#126539\&quot;, \&quot;Invoice Date\&quot;: \&quot;01/27/2024\&quot;, \&quot;Company Name\&quot;: \&quot;Acme Plumbing Company LLC\&quot;, \&quot;Company Address\&quot;: \&quot;145 Corporate Park Place Southbroom IL ,62006 USA \&quot;, \&quot;Phone number\&quot;: \&quot;+15553338888\&quot;}&quot;,<br>     &quot;created_at&quot;: &quot;2024-09-20T00:00:00.000-07:00&quot;,<br>     &quot;completion_reason&quot;: &quot;done&quot;<br>}</pre><p>In this instance, while it pulled correct data, it didn’t do as good of a job pulling any field from the document that one might want saved as metadata. I would probably not change to this model for this use case.</p><h3>Wrap up</h3><p>This tutorial is just the tip of the iceberg in showing off what you can do with the Box AI Platform API. At Box, we pride ourselves in providing developers with the flexibility to create solutions in the way that best fits their business use cases. With the new option to customize the AI model, we continue this journey. As we move forward, Box plans to add even more models and options for you to choose your own AI adventure.</p><p>Happy coding!</p><h4>Resources</h4><p><a href="https://www.youtube.com/playlist?list=PLCSEWOlbcUyI2ta24oRr75_4igvMzKJ9q">Box AI Platform API demos</a></p><p><a href="https://developer.box.com/guides/box-ai/supported-models/">Supported Box AI override model options</a></p><p><a href="https://developer.box.com/reference/get-ai-agent-default/">Get default agent endpoint</a></p><p><em>Find more sample code, tutorials, and more information about the Box AI Platform API in our </em><a href="https://developer.box.com/ai-dev-zone/"><em>Box AI Developer Zone</em></a><em>.</em></p><p><em>In order to use the Box AI Platform API endpoints, you must be an Enterprise Plus customer. You must have an application created in the developer console with the appropriate Box AI scope, and your Box instance must have Box AI enabled. Currently, metadata extraction endpoints are in private beta. To use these, you will need to contact your account team.</em></p><p>🦄 <em>Want to engage with other Box Platform champions?</em></p><p><em>Join our</em><a href="https://community.box.com/box-platform-5"><em> Box Developer Community </em></a><em>for support and knowledge sharing!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6675ccfcfb35" width="1" height="1" alt=""><hr><p><a href="https://medium.com/box-developer-blog/tutorial-box-ai-platform-api-ai-agent-override-options-6675ccfcfb35">[Tutorial] Box AI API — AI model override options</a> was originally published in <a href="https://medium.com/box-developer-blog">Box Developer Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[Video] Box AI Platform API partner spotlight — LlamaIndex]]></title>
            <link>https://medium.com/box-developer-blog/video-box-ai-platform-api-partner-spotlight-llamaindex-0fd6e3f856f7?source=rss-246952a91969------2</link>
            <guid isPermaLink="false">https://medium.com/p/0fd6e3f856f7</guid>
            <category><![CDATA[box]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[cloud]]></category>
            <dc:creator><![CDATA[Alex Novotny]]></dc:creator>
            <pubDate>Tue, 24 Sep 2024 15:02:24 GMT</pubDate>
            <atom:updated>2024-09-24T15:02:24.683Z</atom:updated>
            <content:encoded><![CDATA[<h3>[Video] Box AI Platform API partner spotlight — LlamaIndex</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HIvYxFCZKZt0EnQmUD6X_w.png" /></figure><p>For our final video in the <a href="https://www.youtube.com/watch?v=amhOj0YRVRQ&amp;list=PLCSEWOlbcUyI2ta24oRr75_4igvMzKJ9q">Box AI Platform API series</a>, Box developer advocate Alex Novotny sits down with one of our brand new partners Laurie Voss, VP of developer relations from Llamaindex. Checkout the interview where they discuss all things AI, Box, and Llamaindex!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F4YIDmjCAaK4%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D4YIDmjCAaK4&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F4YIDmjCAaK4%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/6d3f9bce54b8976287cdd3be2b7022a6/href">https://medium.com/media/6d3f9bce54b8976287cdd3be2b7022a6/href</a></iframe><p>Find out how to use the new integration in a previous <a href="https://medium.com/box-developer-blog/box-llama-index-readers-the-cool-stuff-3fce0c92ab0b">blog post</a> posted by Rui Barbosa.</p><p>Learn more about Llamaindex on their web<a href="https://www.llamaindex.ai/">site</a>.</p><p>Find sample code, tutorials, and more about the Box AI Platform API in our <a href="https://developer.box.com/ai-dev-zone/">Box AI Developer Zone</a>.</p><p><em>In order to use the Box AI Platform API endpoints, you must be an Enterprise Plus customer. You must have an application created in the developer console with the appropriate Box AI scope, and your Box instance must have Box AI enabled. Currently, metadata extraction endpoints are in private beta. To use these, you will need to contact your account team.</em></p><p>🦄 <em>Want to engage with other Box Platform champions?</em></p><p><em>Join our</em><a href="https://community.box.com/box-platform-5"><em> Box Developer Community </em></a><em>for support and knowledge sharing!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0fd6e3f856f7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/box-developer-blog/video-box-ai-platform-api-partner-spotlight-llamaindex-0fd6e3f856f7">[Video] Box AI Platform API partner spotlight — LlamaIndex</a> was originally published in <a href="https://medium.com/box-developer-blog">Box Developer Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[Video] Box AI Platform API developer roundtable]]></title>
            <link>https://medium.com/box-developer-blog/video-box-ai-platform-api-developer-roundtable-0d99d32e8947?source=rss-246952a91969------2</link>
            <guid isPermaLink="false">https://medium.com/p/0d99d32e8947</guid>
            <category><![CDATA[box]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Alex Novotny]]></dc:creator>
            <pubDate>Wed, 18 Sep 2024 14:35:12 GMT</pubDate>
            <atom:updated>2024-09-18T14:35:12.411Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GfRqrAvzxXupcsfp8JX_aQ.png" /></figure><p>We’ve added a new video to our <a href="https://www.youtube.com/watch?v=amhOj0YRVRQ&amp;list=PLCSEWOlbcUyI2ta24oRr75_4igvMzKJ9q">Box AI Platform API series</a>! In this developer roundtable, Box developer advocate Alex Novotny chats with three Box customers — Mike Curry, director of software engineering at Riverpoint Capital, Geoff Moore, CIO at Valmark Financial Group, and Umang Beri, director of data and systems at NAF. They discuss their current/potential future use cases and experiences with the new Box AI Platform API.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FPg_OJSFGp0U%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DPg_OJSFGp0U&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FPg_OJSFGp0U%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/16480c870ef9e2b52c0d87caf66da3db/href">https://medium.com/media/16480c870ef9e2b52c0d87caf66da3db/href</a></iframe><p>Find sample code, tutorials, and more about the Box AI Platform API in our <a href="https://developer.box.com/ai-dev-zone/">Box AI Developer Zone</a>.</p><p><em>In order to use the Box AI Platform API endpoints, you must be an Enterprise Plus customer. You must have an application created in the developer console with the appropriate Box AI scope, and your Box instance must have Box AI enabled. Currently, metadata extraction endpoints are in private beta. To use these, you will need to contact your account team.</em></p><p>🦄 <em>Want to engage with other Box Platform champions?</em></p><p><em>Join our</em><a href="https://community.box.com/box-platform-5"><em> Box Developer Community </em></a><em>for support and knowledge sharing!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0d99d32e8947" width="1" height="1" alt=""><hr><p><a href="https://medium.com/box-developer-blog/video-box-ai-platform-api-developer-roundtable-0d99d32e8947">[Video] Box AI Platform API developer roundtable</a> was originally published in <a href="https://medium.com/box-developer-blog">Box Developer Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[Video] Box AI Platform API interviews]]></title>
            <link>https://medium.com/box-developer-blog/video-box-ai-platform-api-interviews-6f7d28466c03?source=rss-246952a91969------2</link>
            <guid isPermaLink="false">https://medium.com/p/6f7d28466c03</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[box]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Alex Novotny]]></dc:creator>
            <pubDate>Tue, 10 Sep 2024 14:45:17 GMT</pubDate>
            <atom:updated>2024-09-10T14:45:54.955Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9HjJxVDAX62lsG3ebJaGPw.png" /></figure><p>Following the release of our <a href="https://medium.com/box-developer-blog/video-box-ai-platform-api-demos-69286928bcd6">first set of Box AI Platform API demo videos</a> last week, I am happy to announce our second set, where I sat down with several folks to discuss all the moving parts of the newly released endpoints. Each video below focuses on a different high-level topic. As always, feel free to share them with your network.</p><h4>The next iteration</h4><p>Find out more about what’s coming next with the Box AI Platform API from Box CTO, Ben Kus.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fz0plUHGx1V0%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dz0plUHGx1V0&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fz0plUHGx1V0%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/6dfc0b8a28e0cc8b503eae57f343c663/href">https://medium.com/media/6dfc0b8a28e0cc8b503eae57f343c663/href</a></iframe><h4>Why it matters</h4><p>In this clip, Box CPO Diego Dugatkin discusses why Box chose to expose Box AI via our public API.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FNA4NiqBdSg4%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DNA4NiqBdSg4&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FNA4NiqBdSg4%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/c3b26baf61d4dd8089f3487c874b189c/href">https://medium.com/media/c3b26baf61d4dd8089f3487c874b189c/href</a></iframe><h4>Beyond Box</h4><p>Box senior product manager Helena Tan discusses Box’s vision for beyond-Box AI solutions — including her thoughts on our upcoming Content AI reference architecture.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F2V2tTixIBlc&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D2V2tTixIBlc&amp;image=http%3A%2F%2Fi.ytimg.com%2Fvi%2F2V2tTixIBlc%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/6145520b4d402db1a08eda34233220f6/href">https://medium.com/media/6145520b4d402db1a08eda34233220f6/href</a></iframe><h4>Product spotlight</h4><p>Hear from Box staff product manager Deeksha Malhotra on our product roadmap for the Box AI Platform API.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FXvtb3um6aic%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DXvtb3um6aic&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FXvtb3um6aic%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/8b55c68ada020aabb47c2902a34b458a/href">https://medium.com/media/8b55c68ada020aabb47c2902a34b458a/href</a></iframe><h4>Engineering spotlight</h4><p>Hear from Box senior software engineer Marie Rogers on her day-to-day work developing the Box AI Platform API.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FosP1lXSGhfE%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DosP1lXSGhfE&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FosP1lXSGhfE%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/31f5c13002c1b9b9375010b5cfc5e988/href">https://medium.com/media/31f5c13002c1b9b9375010b5cfc5e988/href</a></iframe><h4>Customer spotlight</h4><p>Hear from Box customer Mike Curry, director of software engineering at Riverpoint Capital, on their use case with the Box AI Platform API.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FuZkfd2s8D9U%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DuZkfd2s8D9U&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FuZkfd2s8D9U%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/afe865abb662209428ec83e4b487a633/href">https://medium.com/media/afe865abb662209428ec83e4b487a633/href</a></iframe><p><em>In order to use the Box AI Platform API endpoints, you must be an Enterprise Plus customer. You must have an application created in the developer console with the appropriate Box AI scope, and your Box instance must have Box AI enabled. Currently, metadata extraction endpoints are in private beta. To use these, you will need to contact your account team.</em></p><p>🦄 <em>Want to engage with other Box Platform champions?</em></p><p><em>Join our</em><a href="https://community.box.com/box-platform-5"><em> Box Developer Community </em></a><em>for support and knowledge sharing!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6f7d28466c03" width="1" height="1" alt=""><hr><p><a href="https://medium.com/box-developer-blog/video-box-ai-platform-api-interviews-6f7d28466c03">[Video] Box AI Platform API interviews</a> was originally published in <a href="https://medium.com/box-developer-blog">Box Developer Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>