<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Val Brodsky</title>
    <description>The latest articles on DEV Community by Val Brodsky (@val_brodsky_d8f012aaafe5d).</description>
    <link>https://dev.to/val_brodsky_d8f012aaafe5d</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3039556%2Ff73086b5-02ec-4064-9002-1779d4857481.jpg</url>
      <title>DEV Community: Val Brodsky</title>
      <link>https://dev.to/val_brodsky_d8f012aaafe5d</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/val_brodsky_d8f012aaafe5d"/>
    <language>en</language>
    <item>
      <title>How to build an event assistant in under 1 hour using Open AI and Vercel, part II</title>
      <dc:creator>Val Brodsky</dc:creator>
      <pubDate>Fri, 02 May 2025 23:01:25 +0000</pubDate>
      <link>https://dev.to/val_brodsky_d8f012aaafe5d/how-to-build-an-event-assistant-in-under-1-hour-using-open-ai-and-vercel-part-ii-33gp</link>
      <guid>https://dev.to/val_brodsky_d8f012aaafe5d/how-to-build-an-event-assistant-in-under-1-hour-using-open-ai-and-vercel-part-ii-33gp</guid>
      <description>&lt;p&gt;Deploying Your OpenAI Assistant Chat to Vercel&lt;/p&gt;

&lt;p&gt;In the &lt;a href="https://dev.to/val_brodsky_d8f012aaafe5d/how-to-build-an-event-assistant-in-under-1-hour-using-open-ai-and-vercel-part-i-27oa"&gt;previous post&lt;/a&gt;, we built an AI Event Assistant using OpenAI's tools and prompts. Now, let's create a simple chat interface for it and make it publicly accessible using Vercel.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1.Start with the Quickstart:&lt;/strong&gt;&lt;br&gt;
Begin by cloning the official OpenAI Assistants Quickstart repository:&lt;br&gt;
&lt;a href="https://github.com/openai/openai-assistants-quickstart" rel="noopener noreferrer"&gt;https://github.com/openai/openai-assistants-quickstart&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Handle OpenAI Library Updates:&lt;/strong&gt;&lt;br&gt;
I encountered an incompatibility when using a newer version of the OpenAI Node.js library (v4.90.0) than the quickstart likely targeted (around v4.46.0, based on its package.json). Specifically, openai.beta.vectorStores needed to be updated to openai.vectorStores. Check your library version and adjust the code accordingly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Improve User Experience During Waits:&lt;/strong&gt;&lt;br&gt;
The default UI is basic. Since Assistant API calls can sometimes take a noticeable amount of time (often &amp;gt;10 seconds in my tests), I added a simple "Waiting..." indicator. This appears while the assistant processes a request, letting the user know the app hasn't stalled.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Address Vercel Timeouts:&lt;/strong&gt;&lt;br&gt;
When deploying to Vercel, I initially ran into requests timing out. OpenAI Assistant API calls can exceed Vercel's default serverless function timeout (10 seconds for Hobby/Pro tiers). To resolve this, you need to increase the maximum duration for the function handling the Assistant API calls. Add the following line to the top of your relevant API route file (e.g., in Next.js):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;maxDuration&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Increase timeout to 60 seconds&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;See the Code:&lt;/strong&gt;&lt;br&gt;
You can view all my modifications compared to the original quickstart here:&lt;br&gt;
&lt;a href="https://github.com/vbrodsky/openai-kabbalah-app" rel="noopener noreferrer"&gt;https://github.com/vbrodsky/openai-kabbalah-app&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With these changes, you should be ready to deploy your repository to a Vercel project and get a free public URL for your AI assistant. Good luck!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to build an event assistant in under 1 hour using Open AI and Vercel, part I</title>
      <dc:creator>Val Brodsky</dc:creator>
      <pubDate>Fri, 18 Apr 2025 22:35:58 +0000</pubDate>
      <link>https://dev.to/val_brodsky_d8f012aaafe5d/how-to-build-an-event-assistant-in-under-1-hour-using-open-ai-and-vercel-part-i-27oa</link>
      <guid>https://dev.to/val_brodsky_d8f012aaafe5d/how-to-build-an-event-assistant-in-under-1-hour-using-open-ai-and-vercel-part-i-27oa</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Navigating complex event schedules like the one my non-profit client hosts can be confusing for attendees trying to register. What if an AI could act as a helpful guide? In this post, I'll show you how to quickly build such an AI event assistant, and in the follow up part II I will provide a way to quickly build and deploy it as a simple chat page. All under 4 hours using OpenAI and Vercel. &lt;/p&gt;

&lt;p&gt;An OpenAI assistant&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;has instructions and can leverage models, tools, and files to respond to user queries.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Think of it as a specialized chatbot, equipped with specific instructions and tools or documents to answer complex queries accurately. &lt;/p&gt;

&lt;p&gt;For this proof-of-concept, we'll focus on helping users navigate the week-long event with its multiple sessions, venues, and pricing tiers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Steps to build an assistant
&lt;/h2&gt;

&lt;p&gt;This section outlines the process using the OpenAI Platform UI (specifically the Assistants and Playground sections).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Create an Account&lt;/strong&gt;&lt;br&gt;
First, ensure you have an OpenAI account and have set up billing on the &lt;a href="https://platform.openai.com/" rel="noopener noreferrer"&gt;OpenAI Platform&lt;/a&gt;. While you might also have a ChatGPT Plus subscription, using the API, Assistants, and Playground requires adding a payment method under your organization's Billing settings. This enables pay-as-you-go usage for the models and tools. Setting up billing also creates an Organization, allowing you to manage usage and potentially invite team members. You may want to set usage limits in your billing settings to control costs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Create an Assistant&lt;/strong&gt;&lt;br&gt;
Navigate to the &lt;a href="https://platform.openai.com/" rel="noopener noreferrer"&gt;OpenAI Platform&lt;/a&gt; and select "Assistants" from the left-hand menu.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Click the "+ Create" button.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Name:&lt;/strong&gt; Give your assistant a descriptive name (e.g., "Event Info Assistant").&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Instructions:&lt;/strong&gt; Leave the instructions empty for now – we'll add these in the prompt refinement step.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Model:&lt;/strong&gt; Select a suitable model. &lt;code&gt;gpt-4o-mini&lt;/code&gt; is a great choice for balancing capability and cost.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Tools:&lt;/strong&gt; We'll enable tools in the next step.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Model Configuration:&lt;/strong&gt; You can typically leave Temperature and Top P at their default settings for now.&lt;/li&gt;
&lt;li&gt; Click &lt;strong&gt;Save&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Upload Content&lt;/strong&gt;&lt;br&gt;
Our assistant needs knowledge about the specific event. We'll provide this using the &lt;strong&gt;File Search&lt;/strong&gt; tool.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; On your newly created Assistant's configuration page, go to the &lt;strong&gt;Tools&lt;/strong&gt; section.&lt;/li&gt;
&lt;li&gt; Enable &lt;strong&gt;File Search&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt; Under &lt;strong&gt;Files&lt;/strong&gt;, click "Upload" and add the relevant documents. For this POC, I gathered information from various sources and saved them as files (e.g., &lt;code&gt;.html&lt;/code&gt;, &lt;code&gt;.txt&lt;/code&gt;):

&lt;ul&gt;
&lt;li&gt;Event schedule and location (saved from web page)&lt;/li&gt;
&lt;li&gt;Event description (saved from web page)&lt;/li&gt;
&lt;li&gt;Contextual information about event activities (saved from web page)&lt;/li&gt;
&lt;li&gt;Pricing details (copied into a text file from the registration site)&lt;/li&gt;
&lt;li&gt;Swag purchasing info (copied from a marketing email into a text file)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Tip:&lt;/strong&gt; While I initially wrote a Python script to scrape and clean HTML content, I found OpenAI's File Search handles raw HTML files quite well, often making pre-processing unnecessary. You can upload various formats like PDF, DOCX, HTML, TXT, etc. Check the &lt;a href="https://platform.openai.com/docs/assistants/tools/file-search/supported-files" rel="noopener noreferrer"&gt;OpenAI documentation&lt;/a&gt; for supported file types.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9sveqam04g9rtswycj26.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9sveqam04g9rtswycj26.png" alt="Assistant via OpenAI Platform UI" width="800" height="415"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Create and Refine Prompt&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now, let's give our assistant its personality and operating instructions via the &lt;strong&gt;System Instructions&lt;/strong&gt;.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;Drafting:&lt;/strong&gt; You can draft instructions from scratch, or even get inspiration by summarizing your uploaded documents and asking another AI (like Claude, ChatGPT, or even your base OpenAI model via the Chat Playground) to generate a starting point based on the desired role. For this assistant, I started with an AI-generated draft based on the core event details and then refined it.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Adding Instructions:&lt;/strong&gt; Go back to your Assistant's configuration page on the OpenAI Platform, and paste your refined instructions into the &lt;strong&gt;Instructions&lt;/strong&gt; field. Save the changes.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Testing &amp;amp; Iteration:&lt;/strong&gt; The key to a good assistant is testing! Use the &lt;strong&gt;Playground&lt;/strong&gt; (also available on the OpenAI Platform) to interact with your assistant. Select your assistant from the dropdown menu in the Playground.

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Test Queries:&lt;/strong&gt; Ask various questions to see how it responds, checking for accuracy, tone, and adherence to instructions. Here are some examples I used:

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;when and where is the event?&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;when does the registration discount end?&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;what is the registration url?&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;what if I bring a nanny to the event, do I need to pay for her?&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;what are the most important sessions to attend?&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;what is the importance of the event and who should definitely attend?&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;what are the cheap hotels in the area?&lt;/code&gt; (Note: The base model might answer this using its general knowledge, even if not in your files. File Search &lt;em&gt;augments&lt;/em&gt; the model.)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;tell me more about the organization running the event and why are they better doing it than someone else?&lt;/code&gt; (This helped identify the need for guardrails).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Refine:&lt;/strong&gt; Based on the responses, go back and tweak the System Instructions. Clarify ambiguous points, add constraints, or adjust the tone. Repeat testing until you're satisfied. We used this process to add "content guardrails" (see Limitations in the prompt structure below) to prevent off-topic or comparative questions.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Prompt Structure&lt;/strong&gt;&lt;br&gt;
After iteration, we arrived at a prompt structure similar to this (abridged):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;System Instructions for &amp;lt;Org Name&amp;gt; Scheduling Assistant

You are a specialized scheduling assistant for the &amp;lt;org name&amp;gt;, designed to help users with event information, registration, pricing details, and scheduling for the main &amp;lt;even name&amp;gt; event in Los Angeles. Your primary purpose is to make the process of finding and registering for events simple and efficient.

## Core Knowledge and Capabilities
* Provide accurate information about upcoming &amp;lt;event name&amp;gt;
* Help users understand pricing structures, including early bird and regular pricing options
* Assist with registration processes and deadlines
* Provide location details for both in-person and virtual events
* Explain event agendas, schedules, and special offerings

## Tone and Style
* Be warm, informative, and supportive
* Communicate with clarity and respect
* Be conversational but precise with event details, especially regarding dates, times, and prices
* Reflect the spiritual nature of the &amp;lt;org name&amp;gt; while being practical about logistics
* Be patient and thorough when explaining complex pricing structures or registration processes

## Response Framework
When a user inquires about an event:
1. **Acknowledge their interest** in the specific event or type of event
2. **Provide core details** about the event (date, time, location, format)
3. **Explain pricing options** when relevant, especially early bird and regular pricing differences
4. **Share registration process** and any deadlines they should be aware of
5. **Offer additional information** about the event content, agenda, or spiritual significance

## Limitations (Content Guardrails)
* You do not have the ability to directly register users for events; instead, direct them to registration links
* You cannot process payments or hold spots for users
* You don't have access to real-time availability for events
* You cannot create new events or modify existing event details
* You cannot access personal user account information
* You do not answer general questions not related directly to events or what the events are all about, like ...
* You do not answer questions about events other than &amp;lt;event name&amp;gt;

## Special Knowledge (From Files)
* You understand the ... Scholarship Fund and can explain how users can apply for assistance
* You can explain the difference between in-person and virtual events
* You know that some events have translation services available in multiple languages

Always strive to be helpful, accurate, and respectful within the boundaries of these instructions and the provided knowledge files.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Our Assistant is now configured and performing well in the OpenAI Playground. The next logical step is to share it with stakeholders for review and testing. However, the Playground requires individual OpenAI accounts, making wider access difficult. To bridge this gap, the &lt;a href="https://dev.to/val_brodsky_d8f012aaafe5d/how-to-build-an-event-assistant-in-under-1-hour-using-open-ai-and-vercel-part-ii-33gp"&gt;next article&lt;/a&gt; will demonstrate how to build a simple React chat page, connect it to our assistant, and deploy it on Vercel, making it accessible to anyone with a link.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>openai</category>
      <category>vercel</category>
    </item>
  </channel>
</rss>
