Spaces:
Runtime error
Runtime error
File size: 1,223 Bytes
ccefedb cf1be5a ccefedb cf1be5a ad33a27 cf1be5a ad33a27 ccefedb ad33a27 ccefedb c4c71a9 edb1715 c4c71a9 |
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 |
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}"
)
try:
# 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"
except Exception as e:
print(f"Error: {e}")
break |