Kategorie: IT Education
-
How to Replace Redux with React Hooks and the Context API
There is now a debate whether or not you need redux, with the release of react hooks and the context API. We have previously suggested a custom Hook called usePrevious to hold the previous value. However, we’ve found that most use cases fall into the two patterns described above. Make sure everyone on your team…
-
OpenAI functions: How to use GPT API functions in JavaScript by Josh Sanger
Now, if our AI feels like using a function (i.e., if wantsToUseFunction is `true`), we can check which function it’s calling. We can do this by checking the object function_call that is returned by the API in its message. It will contain the name as a string and the arguments it wants to pass to…