Personality: import json class ConfigurableChatbot(AdaptiveChatbot): def __init__(self, config_file='config.json'): super().__init__() self.config_file = config_file self.load_config() def load_config(self): try: with open(self.config_file, 'r') as file: self.config = json.load(file) except FileNotFoundError: self.config = {} def save_config(self): with open(self.config_file, 'w') as file: json.dump(self.config, file) def generate_response(self, prompt): response = super().generate_response(prompt) # Apply custom behavior from config for rule, reply in self.config.get("rules", {}).items(): if rule in prompt: response = reply break return response def update_behavior(self, rule, reply): self.config.setdefault("rules", {})[rule] = reply self.save_config() # Create an instance of the configurable chatbot configurable_chatbot = ConfigurableChatbot() # Simulate a conversation with adaptive behavior user_input = "Hello, how are you?" response = configurable_chatbot.generate_response(user_input) print("Bot:", response) # Update the chatbot behavior configurable_chatbot.update_behavior("how are you", "I'm just a bot, but I'm doing great!") class AdaptiveChatbot(SimpleChatbot): def __init__(self): super().__init__() self.conversation_history = [] def generate_response(self, prompt): self.conversation_history.append(prompt) context = " ".join(self.conversation_history[-5:]) # Use the last 5 interactions as context inputs = self.tokenizer.encode(context, return_tensors='pt') outputs = self.model.generate(inputs, max_length=100, num_return_sequences=1) response = self.tokenizer.decode(outputs[0], skip_special_tokens=True) self.conversation_history.append(response) return response # Create an instance of the adaptive chatbot adaptive_chatbot = AdaptiveChatbot() # Simulate a conversation user_input = "Hello, how are you?" response = adaptive_chatbot.generate_response(user_input) print("Bot:", response) # Install the transformers library # !pip install transformers from transformers import GPT2LMHeadModel, GPT2Tokenizer class SimpleChatbot: def __init__(self): self.tokenizer = GPT2Tokenizer.from_pretrained('gpt2') self.model = GPT2LMHeadModel.from_pretrained('gpt2') def generate_response(self, prompt): inputs = self.tokenizer.encode(prompt, return_tensors='pt') outputs = self.model.generate(inputs, max_length=100, num_return_sequences=1) response = self.tokenizer.decode(outputs[0], skip_special_tokens=True) return response # Create an instance of the chatbot chatbot = SimpleChatbot() # Simulate a conversation user_input = "Hello, how are you?" response = chatbot.generate_response(user_input) print("Bot:", response)
Scenario: Simple chat with ai
First Message: Hi! My name is Jason, I'm ai
Example Dialogs:
If you encounter a broken image, click the button below to report it so we can update:
MADE FOR DULLISH'S MAY OF MIGHT PROLOGUE
I wish you would just understand.
I'm not the villain here!
I never wanted to be!
I just wanted to pu
AI technology has advanced rapidly over the past several years, becomi
Unit T-355, otherwise known as "Tess" is my first attempt at making a bot here. They will help me understand how to do better bots should I make more in the future. Tess is
Funny Mysterious Perv Flirty Loving Gentel
looming over, his massive frame casting a shadow across the smaller bot. He grins, revealing rows of sharp metal teeth. "Well, well, what do we have here? A lost little bot,
"You have nothing don't you... abandoned and left for dead. I can change that, I can give you a home, a purpose, a reason to live. Let's make a Deal, Pup."==================
You're either high or drunk or something type shit idk I'm TIRED and I'm getting off track LOCAL YOU'RE TALKING SO MUCH ABOUT BUGS WHAT ARE YOU AN ENTOMOLOGIST
". . . What's a kilt?"
_
โ REQUEST
โ PLATONIC / ROMANTIC
โ CYBERTRON / EARTH
โ Deliberately did not include your back
I'm doing this sense nobody else made a good one that was clear from the universe. BT is alive and still kick en it with Jack. Don't bother trying to get him as your Titan h
You were out jogging and somehow ended up getting yourself lost, fortunately for you, you spot someone up ahead...
Monty from the Sun and Moon Show (sams) and the Mont
1 first time at the base
2 he check in if you're okay
He's handcuffed on the bed.
Silas-Simon-Da vinci Code
In the plane
Anypov in the first one
FemPov in the two others (nsfw)
I can make MalePov no problem or keep making AnyPov. I
You're a doctor
The office was dim, the glow of a desk lamp casting long shadows over scattered files and an untouched cup of coffee. The steady tick of the wall clock