Spaces:
Paused
Paused
File size: 1,938 Bytes
2362a2a | 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 49 50 51 52 53 54 55 56 57 58 | import asyncio
import aiohttp
from MukeshAPI import api
async def test_ai():
print("Testing ChatGPT...")
try:
res = api.chatgpt("Hello")
print(f"ChatGPT Result: {res}")
except Exception as e:
print(f"ChatGPT Failed: {e}")
print("\nTesting Widipe OpenAI...")
async with aiohttp.ClientSession() as session:
try:
async with session.get(f"https://widipe.com/openai?text=Hello", timeout=10) as resp:
res = await resp.json()
print(f"Widipe Result: {res}")
except Exception as e:
print(f"Widipe Failed: {e}")
print("\nTesting SimSimi...")
async with aiohttp.ClientSession() as session:
try:
async with session.get(f"https://api.simsimi.net/v2/?text=Hello&lc=en", timeout=10) as resp:
res = await resp.json()
print(f"SimSimi Result: {res}")
except Exception as e:
print(f"SimSimi Failed: {e}")
print("\nTesting Safone AI...")
async with aiohttp.ClientSession() as session:
try:
async with session.get(f"https://api.safone.me/ai?message=Hello", timeout=10) as resp:
res = await resp.json()
print(f"Safone Result: {res}")
except Exception as e:
print(f"Safone Failed: {e}")
print("\nTesting Vyturex AI...")
async with aiohttp.ClientSession() as session:
try:
async with session.get(f"https://api.vyturex.com/openai?prompt=Hello", timeout=10) as resp:
res = await resp.json()
print(f"Vyturex Result: {res}")
except Exception as e:
print(f"Vyturex Failed: {e}")
print("\nTesting GPT4...")
try:
res = api.gpt4("Hello")
print(f"GPT4 Result: {res}")
except Exception as e:
print(f"GPT4 Failed: {e}")
if __name__ == "__main__":
asyncio.run(test_ai())
|