Spaces:
Running
Running
import asyncio | |
import logging | |
from ai_core_agix import AICore | |
async def main(): | |
try: | |
logging.info("Initializing AI Core...") | |
ai_core = AICore(config_path="config.json") | |
query = "What is the latest in AI advancements?" | |
logging.info(f"Processing query: {query}") | |
response = await ai_core.generate_response(query, user_id=1) | |
logging.info("Response received successfully.") | |
print("AI Response:", response) | |
await ai_core.http_session.close() | |
logging.info("Closed AI Core session.") | |
except Exception as e: | |
logging.error(f"An error occurred: {e}") | |
if __name__ == "__main__": | |
asyncio.run(main()) |