Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -1,12 +1,22 @@
|
|
1 |
import asyncio
|
2 |
-
|
|
|
3 |
|
4 |
async def main():
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
if __name__ == "__main__":
|
12 |
-
asyncio.run(main())
|
|
|
1 |
import asyncio
|
2 |
+
import logging
|
3 |
+
from ai_core_agix import AICore
|
4 |
|
5 |
async def main():
|
6 |
+
try:
|
7 |
+
logging.info("Initializing AI Core...")
|
8 |
+
ai_core = AICore(config_path="config.json")
|
9 |
+
query = "What is the latest in AI advancements?"
|
10 |
+
logging.info(f"Processing query: {query}")
|
11 |
+
|
12 |
+
response = await ai_core.generate_response(query, user_id=1)
|
13 |
+
logging.info("Response received successfully.")
|
14 |
+
print("AI Response:", response)
|
15 |
+
|
16 |
+
await ai_core.http_session.close()
|
17 |
+
logging.info("Closed AI Core session.")
|
18 |
+
except Exception as e:
|
19 |
+
logging.error(f"An error occurred: {e}")
|
20 |
|
21 |
if __name__ == "__main__":
|
22 |
+
asyncio.run(main())
|