Python AI Choose Your Own Adventure Game - Tutorial

Tech With Tim · 374K views · 2023 · 31:09

Open on YouTube

LLMs & generative AIPython, Ruby & scripting languagestutorialdated

Why Stack Overflow recommends it

Stack Overflow users cite it as the tutorial they were following when they hit errors, mostly from LangChain import changes and Cassandra driver setup that have changed since 2023.

Recommended by 0 people across 0 different months, 2023 to 2024.

What it is

A Tech With Tim tutorial that builds an AI choose-your-own-adventure text game in under 100 lines of Python. It uses OpenAI for story generation, LangChain for the prompt chain, and an Astra (Cassandra) vector database for conversation memory. It also explains why LLMs need external memory.

What people said

Cites Atabek · 2023-10 · Stack Overflow · on “Importing LLMChain from langchain root module is no longer supported”

I am trying to create an adventure game with AI, based on this tutorial [this video] However, I am getting error message like this: Importing LLMChain from langchain root module is no longer supported. This is the code: from cassandra.cluster import Cluster from cassandra.auth import PlainTextAuthProvider from langchain.memory import CassandraChatMessageHistory, ConversationBufferMemory from langchain.llms import OpenAI from langchain import LLMChain, PromptTemplate import json cloud_config= { 'secure_connect_bundle': 'secure-connect-choose-your-own-adventure.zip' } with open("choose_your_own_adventure-token.json") as f: secrets = json.load(f) CLIENT_ID = secrets["clientId"] CLIENT_SECRET = secre

Cites BakhtiarHossain · 2024-05 · Stack Overflow · on “AI based text game autocompletes user inputs prematurely”

I am trying to write a text-based adventure game following a YouTube tutorial here [this video] . After updating the code according to the latest documentation, I've encountered a problem where the AI responds to the inputs that should be for the player. This issue persists for the first 3-4 inputs, after which the AI stops generating responses altogether. Additionally, I'm unsure about from langchain.chains import LLMChain because LLMChain is highlighted in white instead of green, which is typical for recognized objects in the editor I'm using. Does this indicate an issue with the code? I found that it may be deprecated but I could not find the new class for handling this. Any insights on how to

Cites JonathanA001 · 2024-08 · Stack Overflow · on “Cassandra Python app on Windows returns "The C extension needed to use libev was not found"”

Once I saw an ad about how to make an AI generated your own adventure game in Python, so I went to YouTube and checked the video [this video] out. Even though the video was out of date, I followed along with it pretty well. But when I tried to run a set of Python code that is downloaded from here [LINK] , in particular from cassandra.cluster import Cluster I got an error : Traceback (most recent call last): File "C:\Users\xxxxx\Desktop\My_Database\tutorial.py", line 1, in <module> from cassandra.cluster import Cluster File "cassandra\cluster.py", line 173, in init cassandra.cluster cassandra.DependencyException: Unable to load a default connection class The following exceptions were observed: - T