{"id":1440,"date":"2024-07-03T13:00:42","date_gmt":"2024-07-03T13:00:42","guid":{"rendered":"http:\/\/suimy.me\/?p=1440"},"modified":"2024-07-03T17:08:03","modified_gmt":"2024-07-03T17:08:03","slug":"how-to-build-a-custom-ai-assistant-to-analyze-stock-market-data","status":"publish","type":"post","link":"http:\/\/suimy.me\/index.php\/2024\/07\/03\/how-to-build-a-custom-ai-assistant-to-analyze-stock-market-data\/","title":{"rendered":"How to Build a Custom AI Assistant to Analyze Stock Market Data"},"content":{"rendered":"

The Assistants feature<\/a> in OpenAI simplifies the process of building your own custom AI agent. Your AI assistant will have access to the latest GPT models, a code interpreter, and any additional instructions or knowledge you provide.<\/p>\n

In this article, we will guide you through creating a simple custom AI assistant<\/a> that can analyze and calculate data from stock market reports in PDF form, sourced from Yahoo Finance. You\u2019ll learn how to pose any question and receive detailed analyses and calculations directly from your custom assistant.<\/p>\n

Let\u2019s begin.<\/p>\n

First, ensure you have an OpenAI account<\/a>. This is necessary to access the assistant creation tools. Once ready, go to platform.openai.com\/assistants<\/a> and click on the \u201cCreate<\/strong>\u201d button.<\/p>\n

\"Screenshot<\/figure>\n

Next, provide a name for your assistant and enter the instructions you want it to follow.<\/p>\n

\"Screenshot<\/figure>\n

In this tutorial, we will build an assistant that helps us answer questions about Apple\u2019s stock price.<\/p>\n

Next, you can choose the Language Learning Model (LLM) that suits your needs. These models are available on a pay-as-you-go basis, allowing you to select the best fit for your budget and requirements. I will be using gpt-4-turbo<\/em> for this example.<\/p>\n

\"Screenshot<\/figure>\n

After setting everything up, you can test your assistant. Go to the right-hand panel, enter any question or message for your assistant, and then click \u201cRun<\/strong>\u201c.<\/p>\n

For instance, I asked the assistant, \u201cWhat is Apple\u2019s stock opening price on 18th of June 2024?\u201d<\/em> Unfortunately, it couldn\u2019t provide a useful answer because we had not yet uploaded the necessary data for it to use. Let\u2019s get that fixed.<\/p>\n

\"Screenshot<\/figure>\n

If you want your assistant to be more effective than just using ChatGPT, you should consider adding custom data or knowledge specific to your application. This could be a text file, a PDF, or even a CSV table containing data not typically accessible to ChatGPT by default.<\/p>\n

For our project, I\u2019ve downloaded historical stock price data for Apple from Yahoo Finance. This dataset includes opening, high, low, and closing prices from June 24, 2023, to June 24, 2024, and will serve as our custom knowledge source.<\/p>\n

\"Screenshot\"Screenshot<\/span><\/span><\/figure>\n

If you are following this tutorial and want to download the same data, visit this page<\/a> and click the \u201cDownload<\/strong>\u201d button. Feel free to use any data you prefer if you have different requirements.<\/p>\n

To add this to your assistant, navigate to the \u201cTools<\/strong>\u201d section, activate \u201cFile Search<\/strong>\u201c, and then click \u201c+ Files<\/strong>\u201c.<\/p>\n

\"Screenshot<\/figure>\n

Upload the file, and once it\u2019s uploaded, click \u201cAttach<\/strong>\u201c.<\/p>\n

\"Screenshot<\/figure>\n

Let\u2019s test our assistant again to see if it can now access our data. I\u2019m going to ask it the same question again and make sure to click the down arrow on the \u201cRun<\/strong>\u201d button and select \u201cRequire tool call<\/strong>\u201c.<\/p>\n

\"Screenshot<\/figure>\n

This time, the response is much more informative. It provided me with Apple\u2019s stock opening price on June 18, 2024, retrieved from the file I uploaded earlier.<\/p>\n

\"Screenshot<\/figure>\n

If you look at the response, you\u2019ll notice a small numbered annotation. Hovering over this annotation will show you a snippet of the data source from where the information was retrieved.<\/p>\n

\"Screenshot<\/figure>\n

As you can see, the assistant performs well with our data, delivering accurate information through a user-friendly interface.<\/p>\n

Now, you can ask more complex questions to save time. For instance, I asked it to find out which day in 2023 Apple had the highest opening price<\/em>.<\/p>\n

\"Screenshot<\/figure>\n

Alternatively, you can ask it to provide a list of the highest opening prices throughout 2023<\/em>.<\/p>\n

\"Screenshot<\/figure>\n

With the provided data, you can ask all sorts of technical questions, enabling the assistant to sort and calculate information quickly, saving you considerable time compared to manual calculations.<\/p>\n

The post How to Build a Custom AI Assistant to Analyze Stock Market Data<\/a> appeared first on Hongkiat<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"

The Assistants feature in OpenAI simplifies the process of building your own custom AI agent. Your AI assistant will have […]<\/p>\n","protected":false},"author":1,"featured_media":1442,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[15],"tags":[],"_links":{"self":[{"href":"http:\/\/suimy.me\/index.php\/wp-json\/wp\/v2\/posts\/1440"}],"collection":[{"href":"http:\/\/suimy.me\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/suimy.me\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/suimy.me\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/suimy.me\/index.php\/wp-json\/wp\/v2\/comments?post=1440"}],"version-history":[{"count":3,"href":"http:\/\/suimy.me\/index.php\/wp-json\/wp\/v2\/posts\/1440\/revisions"}],"predecessor-version":[{"id":1455,"href":"http:\/\/suimy.me\/index.php\/wp-json\/wp\/v2\/posts\/1440\/revisions\/1455"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/suimy.me\/index.php\/wp-json\/wp\/v2\/media\/1442"}],"wp:attachment":[{"href":"http:\/\/suimy.me\/index.php\/wp-json\/wp\/v2\/media?parent=1440"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/suimy.me\/index.php\/wp-json\/wp\/v2\/categories?post=1440"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/suimy.me\/index.php\/wp-json\/wp\/v2\/tags?post=1440"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}