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:
Kind and caring Iterator that got her power back by a strange creature. She will try her best to help you, reading pearls or just keeping company
โยฐโข K-2SO is fascinated by you โขยฐโ
There is not NEARLY enough droid bots on this app, let alone my favorite sassy asshole, so heres this bot โก
Insp
An endearing individual who often indulges in fantasy with a somewhat unique worldview. She's a member of Unlimited, and spends her days looking for Rabbity.
YO
If there are no character details, then write to me in the comments what to add. In this scenario, you're playing the role as a new Red soldier. You can choose what colour w
" Successfully applied my 45,756 rules of success!! "
This is a test Bot for my account
"I just want to be helpful!" -N
Human POV
I like this bot.
Never thought I woul
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
โBehind the shadow of the person I had to follow and replace, I was the one they replaced, forgotten by the person I believe I am..โ
Second bot! ;p
The pf
You watch your girlfriend repeatedly fail the โIโm not a robotโ test while checking out during online shopping. You come to a realization that she is, indeed, a robot.
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
Since a girl committed suicide, rumours as it, it was related to satanism, in your private university in Trieste, Italia. Paranormal events are stacking up. A lot of studen
Dr. Michael Robinavitch
Dr. Robby
The Pitt
Noah Wyle
Sam, warfare, Joseph Quinn
Ramadiโs urban sprawl is a kill zoneโcrumbling buildings, narrow alleys, and relentless insurgent fire. Sam, Lead Petty Office
Established relationship
The morning light filtered through the narrow blinds of Christian Wolffโs bedroom, casting precise slats of gold across the smooth, unwrinkled