|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Cryptocurrency News Video
ChatGPT + Node.js | 3 Ways to Overcome the Token Limits
May 14, 2024 at 07:27 am Bret Cameron
Learn how to use the OpenAI API in Node.js and exceed the token limits.
You can find a repository containing everything in this tutorial here: https://github.com/BretCameron/nodejs-openai-memory-system-tutorial/
⏰ Timestamps
00:00 - Intro
00:58 - Project Setup
02:53 - Creating an OpenAI Client
04:01 - Getting Credentials
05:22 - Creating a Basic Conversation with GPT-4
11:25 - Why Token Limits Can Be a Problem
13:00 - Strategy 1: Rolling Context
17:03 - Strategy 2: Summarise Message History
24:03 - Strategy 3: Split into Excerpts by Topic
39:16 - Bonus Tip: Using the Debugger in VSCode
40:50 - Outro
? Description
Right now, it's possible to harness the power of LLMs (large language models) through several public APIs - giving us access to the likes of ChatGPT, Claude and Gemini for use in our own applications.
At a small scale, using these APIs is straightforward. But if we want to support longer conversations or larger amounts of context, sooner or later we will bump into token limits and we'll need to implement our own workarounds.
In this video, I'll walk you through three strategies for overcoming these token limits, so that you can support much longer conversations or much more context - or both!
We'll be using OpenAI's API in Node.js, but the strategies we'll learn can be adapted to pretty-much every mainstream LLM in any server-side programming language.
#nodejs #openai #ai #llm #machinelearning #javascript #typescript
? Article
For a written version of this tutorial, check out my article on Medium: https://medium.com/@bretcameron/3-strategies-to-overcome-openai-token-limits-d60df946f93c
? Links
• Repository: https://github.com/BretCameron/nodejs-openai-memory-system-tutorial/
For those that want to go deeper I recommend this article on memory systems for LLMs by Langchain: https://python.langchain.com/v0.1/docs/modules/memory/
Disclaimer:info@kdj.com
The information provided is not trading advice. kdj.com does not assume any responsibility for any investments made based on the information provided in this article. Cryptocurrencies are highly volatile and it is highly recommended that you invest with caution after thorough research!
If you believe that the content used on this website infringes your copyright, please contact us immediately (info@kdj.com) and we will delete it promptly.
-
- A 29-year-old female lawyer suffered from endocrine disorders, but a 19-year-old male college student climbed into her bed and took the initiative to provide her with treatment.
- May 14, 2024 at 07:27 am Layar Senandika
- The contents of this channel are all film and television drama works. All plots are interpretation scenes without any bad guidance. Please do not imit...
-
- A poor boy was ridiculed by the rich second generation for being too poor. He unexpectedly awakened to the "god-level consumption system". He bought water for a cold school belle for 1 cent and hand-fed water to him for 20 cents. He got a Rolls-Royce for 2 cents. The rich second generation was dumbfounded on the spot, and all the girls in the school rushed to buy it like crazy!
- May 14, 2024 at 07:27 am 望湖劇場Cinema
- Note: This script channel has been authorized, please do not steal, you will be responsible for the consequences #ChineseFilm #Chinesemovie #中文字幕#国剧#精...
-
- With no fish caught for five consecutive days, the family was about to run out of food. Unexpectedly, a colorful lightning bolt fell on the seaside, and I picked up a two-year-old milk baby from a giant shell. I didn't expect that she was a lucky star! One sentence attracted a basket full of large yellow croakers, a piece of fairy grass cured the disabled brother, and the whole family had good luck from now on! #261120hb
- May 14, 2024 at 07:27 am 聼風吟劇場
- # short drama #sweet drama #costume short drama #time travel #rebirth and revenge #大 heroine refreshing drama #mainland drama #mainland short drama #m...
-
- After his rebirth, he rejected the school beauty in public, but turned around and couldn't help but fall in love with his beautiful single mother after a celebration party! After making a huge profit of 400,000 yuan in six days, he chased her and confessed affectionately to her the next day, wanting to spoil her daughter as well!
- May 14, 2024 at 07:27 am 巅峰叙事局
- 🔥 **Welcome to the Peak Narrative Bureau! ** This is the stage for the strong and the legend of the counterattackers! Here, you will see the most pass...
-
- coin Exhibitions from Nov. 2026 to May-- 2027 I Upcoming coin Exhibitions I Coins Collection India
- May 14, 2024 at 07:27 am Coins Collection India
- I give full information about Coins and notes as well as price in current time collectiblecoins #commemorativecoins #britishindiacoins #coin #coincoll...
-
- 🔥Read it in one sitting! Season 9 of "Mortal Cultivation of Immortals: A Jar of Spiritual Grass to the Taoist Ancestor": A loser who first entered the market and was despised by others, inherited from a sloppy and drunken old man, slapped enemies in the face along the way and made breakthroughs to conquer the world of immortality! | MULTI SUB
- May 14, 2024 at 07:27 am 九界动漫 Nine Anime
- 👉 Click to subscribe and enjoy the audio-visual feast at any time! #3d # Comic # Anime # National Comic # Hot Animation # 2026 Most Popular Anime # Co...
-
- [MULTI SUB]💥 Seasons 5-7 of "The Wilderness": A modern social animal accidentally traveled through time, married a sickly scholar, and actually made a fortune by cooking delicious food! # comic drama #ai comic drama # fruit fruit speed screen
- May 14, 2024 at 07:27 am 果果速映
- Thank you for watching. If you like it, you can follow this channel. Wonderful cartoons will be updated every day✨ #最新 animation #国产anime #anime #3d #...
-
- The orphan girl who lives under the shelter of others is plotting her own way to survive. The shady and powerful officials look on with cold eyes and quietly shield her from the wind and rain of the world.
- May 14, 2024 at 07:27 am 恋恋星剧场
- Welcome to @爱爱星 Theater ✨ The main themes are rebirth of sweet love, wealthy sweet pets, encounters through books, and the heroine’s slight counteratt...
-
























