Elemental hero electrum deck12/18/2023 There is also some new logic for handling cases where the script either doesn't finish generating a deck, determined by the presence of a closing "" string in the text, or where it generates multiple (which sometimes happens). The twilio_client object implicitly accesses the account credentials you set as environment variables, and sends the text message at the end. Create a file called deck_generator.py and add the following code to it: This will be called from our eventual Flask app. Let's write the code for sending a text message once the deck list is generated. A Flask app which will handle messages from the user will begin generating a deck list asynchronously using Redis Queue, and when that task is finished a text message will be sent with the deck list. You can buy a phone number here.Īs I mentioned before, generating the text takes too long to simply respond to Twilio's requests to our app for incoming text messages, so we will have to break this up into two parts. Before being able to respond to messages, you’ll need a Twilio phone number. We want to make it so a person can text a phone number and receive a Yugioh deck list. Sending your generated decklist via SMS with Twilio We'll handle this later by using a tool called Redis Queue, which we also have a tutorial for. So one concern I have at this point is that it will take too long to generate this text, resulting in an HTTP timeout when we try to respond to a text message. I haven't been able to get good results for building decks with any of the other models. OpenAI has a variety of different models to choose from, and for this one we are using davinci which is the most advanced but also the slowest. You can do this with the following command, using pip: To test this out yourself, you'll have to install the OpenAI Python module. Working with GPT-3 in Python using the OpenAI helper library The Playground also has a cool feature that allows you to grab some Python code you can run, using OpenAI's Python library, for whatever you used the Playground for. Once you have an OpenAI account, you can use the Playground to play around with GPT-3 by typing in text and having it generate more text. At the time I’m writing this, the only way to obtain one is by being accepted into their private beta program. It even has over 40 cards so it seems to be legal with some small exceptions like having two copies of Raigeki, although as someone who hasn't seriously played this game in over 10 years it blows my mind to see that having 3 copies of Sinister Serpent is actually allowed nowadays.Īs mentioned above, this project requires an API key from OpenAI. I don't think that deck would be great for tournament play, but it looks like those are all cards that actually exist. It is a really fun deck to play and is very competitive. I have only lost to backrow and summon negation. I started off with this deck and it has been amazing. The only problem I have with this deck is that it can't handle backrow and summon negation. It has a good match up against water, fire, wind, and dark decks. I have not tested it against Mermail yet. This deck is really strong and has a good match up against most of the meta. Redis, which you can install with the following commands:Ģ x Dekoichi the Battlechanted Locomotiveġ x Elemental Hero Shining Phoenix Enforcer.ngrok to give us a publicly accessible URL to our code. A Twilio account and a Twilio phone number, which you can buy here.A virtual environment enabled before installing any Python libraries.If your operating system does not provide a Python interpreter, you can go to to download an installer. Let's walk through how to create a text-message powered bot to generate Yugioh deck lists in Python using Twilio Programmable Messaging and OpenAI's API for GPT-3.īefore moving on, you'll need the following: This can be used to generate something similar to pretty much any text found on the internet, including in our case Yugioh deck lists. OpenAI's new GPT-3 (Generative Pre-trained Transformer 3) model was trained on a massive corpus of text making it incredibly powerful. What if we could just have a computer do it for us? Coming up with a deck in any trading card game is often very difficult, and takes a lot of thought and experimentation.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |