summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/nexra
diff options
context:
space:
mode:
Diffstat (limited to 'g4f/Provider/nexra')
-rw-r--r--g4f/Provider/nexra/NexraAnimagineXL.py66
-rw-r--r--g4f/Provider/nexra/NexraBing.py2
-rw-r--r--g4f/Provider/nexra/NexraGeminiPro.py2
-rw-r--r--g4f/Provider/nexra/NexraLLaMA31.py10
-rw-r--r--g4f/Provider/nexra/NexraMidjourney.py2
-rw-r--r--g4f/Provider/nexra/NexraProdiaAI.py2
-rw-r--r--g4f/Provider/nexra/NexraSD15.py2
-rw-r--r--g4f/Provider/nexra/NexraSD21.py2
-rw-r--r--g4f/Provider/nexra/NexraSDLora.py2
-rw-r--r--g4f/Provider/nexra/NexraSDTurbo.py2
-rw-r--r--g4f/Provider/nexra/__init__.py1
11 files changed, 17 insertions, 76 deletions
diff --git a/g4f/Provider/nexra/NexraAnimagineXL.py b/g4f/Provider/nexra/NexraAnimagineXL.py
deleted file mode 100644
index d6fbc629..00000000
--- a/g4f/Provider/nexra/NexraAnimagineXL.py
+++ /dev/null
@@ -1,66 +0,0 @@
-from __future__ import annotations
-
-from aiohttp import ClientSession
-import json
-
-from ...typing import AsyncResult, Messages
-from ..base_provider import AsyncGeneratorProvider, ProviderModelMixin
-from ...image import ImageResponse
-
-
-class NexraAnimagineXL(AsyncGeneratorProvider, ProviderModelMixin):
- label = "Nexra Animagine XL"
- url = "https://nexra.aryahcr.cc/documentation/midjourney/en"
- api_endpoint = "https://nexra.aryahcr.cc/api/image/complements"
- working = True
-
- default_model = 'animagine-xl'
- models = [default_model]
-
- @classmethod
- def get_model(cls, model: str) -> str:
- return cls.default_model
-
- @classmethod
- async def create_async_generator(
- cls,
- model: str,
- messages: Messages,
- proxy: str = None,
- response: str = "url", # base64 or url
- **kwargs
- ) -> AsyncResult:
- # Retrieve the correct model to use
- model = cls.get_model(model)
-
- # Format the prompt from the messages
- prompt = messages[0]['content']
-
- headers = {
- "Content-Type": "application/json"
- }
- payload = {
- "prompt": prompt,
- "model": model,
- "response": response
- }
-
- async with ClientSession(headers=headers) as session:
- async with session.post(cls.api_endpoint, json=payload, proxy=proxy) as response:
- response.raise_for_status()
- text_data = await response.text()
-
- try:
- # Parse the JSON response
- json_start = text_data.find('{')
- json_data = text_data[json_start:]
- data = json.loads(json_data)
-
- # Check if the response contains images
- if 'images' in data and len(data['images']) > 0:
- image_url = data['images'][0]
- yield ImageResponse(image_url, prompt)
- else:
- yield ImageResponse("No images found in the response.", prompt)
- except json.JSONDecodeError:
- yield ImageResponse("Failed to parse JSON. Response might not be in JSON format.", prompt)
diff --git a/g4f/Provider/nexra/NexraBing.py b/g4f/Provider/nexra/NexraBing.py
index 02f3724d..716e9254 100644
--- a/g4f/Provider/nexra/NexraBing.py
+++ b/g4f/Provider/nexra/NexraBing.py
@@ -13,7 +13,7 @@ class NexraBing(AsyncGeneratorProvider, ProviderModelMixin):
label = "Nexra Bing"
url = "https://nexra.aryahcr.cc/documentation/bing/en"
api_endpoint = "https://nexra.aryahcr.cc/api/chat/complements"
- working = True
+ working = False
supports_gpt_4 = False
supports_stream = False
diff --git a/g4f/Provider/nexra/NexraGeminiPro.py b/g4f/Provider/nexra/NexraGeminiPro.py
index 651f7cb4..fb0b096b 100644
--- a/g4f/Provider/nexra/NexraGeminiPro.py
+++ b/g4f/Provider/nexra/NexraGeminiPro.py
@@ -11,7 +11,7 @@ class NexraGeminiPro(AsyncGeneratorProvider, ProviderModelMixin):
label = "Nexra Gemini PRO"
url = "https://nexra.aryahcr.cc/documentation/gemini-pro/en"
api_endpoint = "https://nexra.aryahcr.cc/api/chat/complements"
- working = True
+ working = False
supports_stream = True
default_model = 'gemini-pro'
diff --git a/g4f/Provider/nexra/NexraLLaMA31.py b/g4f/Provider/nexra/NexraLLaMA31.py
index c67febb3..d461f2b2 100644
--- a/g4f/Provider/nexra/NexraLLaMA31.py
+++ b/g4f/Provider/nexra/NexraLLaMA31.py
@@ -17,10 +17,18 @@ class NexraLLaMA31(AsyncGeneratorProvider, ProviderModelMixin):
default_model = 'llama-3.1'
models = [default_model]
+ model_aliases = {
+ "llama-3.1-8b": "llama-3.1",
+ }
@classmethod
def get_model(cls, model: str) -> str:
- return cls.default_model
+ if model in cls.models:
+ return model
+ elif model in cls.model_aliases:
+ return cls.model_aliases.get(model, cls.default_model)
+ else:
+ return cls.default_model
@classmethod
async def create_async_generator(
diff --git a/g4f/Provider/nexra/NexraMidjourney.py b/g4f/Provider/nexra/NexraMidjourney.py
index 3d6a4960..e43cb164 100644
--- a/g4f/Provider/nexra/NexraMidjourney.py
+++ b/g4f/Provider/nexra/NexraMidjourney.py
@@ -12,7 +12,7 @@ class NexraMidjourney(AsyncGeneratorProvider, ProviderModelMixin):
label = "Nexra Midjourney"
url = "https://nexra.aryahcr.cc/documentation/midjourney/en"
api_endpoint = "https://nexra.aryahcr.cc/api/image/complements"
- working = True
+ working = False
default_model = 'midjourney'
models = [default_model]
diff --git a/g4f/Provider/nexra/NexraProdiaAI.py b/g4f/Provider/nexra/NexraProdiaAI.py
index 262558fd..9d82ab9b 100644
--- a/g4f/Provider/nexra/NexraProdiaAI.py
+++ b/g4f/Provider/nexra/NexraProdiaAI.py
@@ -12,7 +12,7 @@ class NexraProdiaAI(AsyncGeneratorProvider, ProviderModelMixin):
label = "Nexra Prodia AI"
url = "https://nexra.aryahcr.cc/documentation/prodia/en"
api_endpoint = "https://nexra.aryahcr.cc/api/image/complements"
- working = True
+ working = False
default_model = 'absolutereality_v181.safetensors [3d9d4d2b]'
models = [
diff --git a/g4f/Provider/nexra/NexraSD15.py b/g4f/Provider/nexra/NexraSD15.py
index 410947df..03b35013 100644
--- a/g4f/Provider/nexra/NexraSD15.py
+++ b/g4f/Provider/nexra/NexraSD15.py
@@ -12,7 +12,7 @@ class NexraSD15(AsyncGeneratorProvider, ProviderModelMixin):
label = "Nexra Stable Diffusion 1.5"
url = "https://nexra.aryahcr.cc/documentation/stable-diffusion/en"
api_endpoint = "https://nexra.aryahcr.cc/api/image/complements"
- working = True
+ working = False
default_model = 'stablediffusion-1.5'
models = [default_model]
diff --git a/g4f/Provider/nexra/NexraSD21.py b/g4f/Provider/nexra/NexraSD21.py
index fc5c90d9..46cd6611 100644
--- a/g4f/Provider/nexra/NexraSD21.py
+++ b/g4f/Provider/nexra/NexraSD21.py
@@ -12,7 +12,7 @@ class NexraSD21(AsyncGeneratorProvider, ProviderModelMixin):
label = "Nexra Stable Diffusion 2.1"
url = "https://nexra.aryahcr.cc/documentation/stable-diffusion/en"
api_endpoint = "https://nexra.aryahcr.cc/api/image/complements"
- working = True
+ working = False
default_model = 'stablediffusion-2.1'
models = [default_model]
diff --git a/g4f/Provider/nexra/NexraSDLora.py b/g4f/Provider/nexra/NexraSDLora.py
index ad986507..a33afa04 100644
--- a/g4f/Provider/nexra/NexraSDLora.py
+++ b/g4f/Provider/nexra/NexraSDLora.py
@@ -12,7 +12,7 @@ class NexraSDLora(AsyncGeneratorProvider, ProviderModelMixin):
label = "Nexra Stable Diffusion Lora"
url = "https://nexra.aryahcr.cc/documentation/stable-diffusion/en"
api_endpoint = "https://nexra.aryahcr.cc/api/image/complements"
- working = True
+ working = False
default_model = 'sdxl-lora'
models = [default_model]
diff --git a/g4f/Provider/nexra/NexraSDTurbo.py b/g4f/Provider/nexra/NexraSDTurbo.py
index feb59f0b..da1428b8 100644
--- a/g4f/Provider/nexra/NexraSDTurbo.py
+++ b/g4f/Provider/nexra/NexraSDTurbo.py
@@ -12,7 +12,7 @@ class NexraSDTurbo(AsyncGeneratorProvider, ProviderModelMixin):
label = "Nexra Stable Diffusion Turbo"
url = "https://nexra.aryahcr.cc/documentation/stable-diffusion/en"
api_endpoint = "https://nexra.aryahcr.cc/api/image/complements"
- working = True
+ working = False
default_model = 'sdxl-turbo'
models = [default_model]
diff --git a/g4f/Provider/nexra/__init__.py b/g4f/Provider/nexra/__init__.py
index d8b9218f..c2e6b2f6 100644
--- a/g4f/Provider/nexra/__init__.py
+++ b/g4f/Provider/nexra/__init__.py
@@ -1,4 +1,3 @@
-from .NexraAnimagineXL import NexraAnimagineXL
from .NexraBing import NexraBing
from .NexraBlackbox import NexraBlackbox
from .NexraChatGPT import NexraChatGPT