Python_codes_data / __init__ (14).py
Ananthusajeev190's picture
Upload 12 files
b39fe3e verified
import json
# Simulated AI models
def sai003(input_text):
# This is a placeholder for the actual AI model's response generation logic
responses = {
"hello": "Hi there!",
"how are you": "I'm just a model, but thanks for asking!",
"bye": "Goodbye!"
}
return responses.get(input_text.lower(), "I'm not sure how to respond to that.")
def anti_venomous(input_text):
# This is a placeholder for the actual AI model's response generation logic
responses = {
"hello": "Greetings!",
"how are you": "I'm functioning as intended, thank you.",
"bye": "Farewell!"
}
return responses.get(input_text.lower(), "I'm not sure how to respond to that.")
# Simulate a conversation
def simulate_conversation():
conversation = []
user_input = "hello"
while user_input.lower() != "bye":
response_sai003 = sai003(user_input)
response_anti_venomous = anti_venomous(response_sai003)
conversation.append({
"user_input": user_input,
"sai003_response": response_sai003,
"anti_venomous_response": response_anti_venomous
})
user_input = input("You: ")
print(f"sai003: {response_sai003}")
print(f"anti-venomous: {response_anti_venomous}")
# Save the conversation to a file
with open('conversation.json', 'w') as file:
json.dump(conversation, file, indent=4)
print("Conversation saved to conversation.json")
# Run the simulation
simulate_conversation()