File size: 1,531 Bytes
b39fe3e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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()