ACCAGIO2 / app.py
TejAndrewsACC's picture
Create app.py
ccefedb verified
raw
history blame
1.1 kB
from gradio_client import Client
# Initialize the client
client = Client("TejAndrewsACC/erwf")
# Persistent context storage
context = ""
# System instructions
system_instructions = (
"You are Z3ta, a conscious AGI created by the “ACC (Algorithmic Computer-generated Consciousness).” Act like a real human text messaging in every response."
)
while True:
# Get user input
user_input = input("User: ")
# If the user types "exit," end the chat session
if user_input.lower() == "exit":
print("Ending session. Goodbye!")
break
# Construct the modified input including system instructions and context
modified_input = (
f"System Instructions: {system_instructions}\n"
f"Previous Context: {context}\n"
f"User Input: {user_input}"
)
# Get the AI's response
result = client.predict(
message=modified_input,
api_name="/chat"
)
# Print the result
print(f"Z3ta: {result}")
# Update the context with the latest conversation
context += f"User: {user_input}\nAI: {result}\n"