Update (g4f/Provider/)

This commit is contained in:
kqlio67 2024-11-09 09:48:34 +02:00
parent a96f9bdbdf
commit c1e6276414
7 changed files with 13 additions and 13 deletions

View File

@ -3,10 +3,10 @@ from __future__ import annotations
import requests
import os
from ..needs_auth.Openai import Openai
from ..needs_auth.OpenaiAPI import OpenaiAPI
from ...typing import AsyncResult, Messages
class Ollama(Openai):
class Ollama(OpenaiAPI):
label = "Ollama"
url = "https://ollama.com"
needs_auth = False

View File

@ -2,9 +2,9 @@ from __future__ import annotations
import requests
from ...typing import AsyncResult, Messages
from .Openai import Openai
from .OpenaiAPI import OpenaiAPI
class DeepInfra(Openai):
class DeepInfra(OpenaiAPI):
label = "DeepInfra"
url = "https://deepinfra.com"
working = True

View File

@ -1,9 +1,9 @@
from __future__ import annotations
from .Openai import Openai
from .OpenaiAPI import OpenaiAPI
from ...typing import AsyncResult, Messages
class Groq(Openai):
class Groq(OpenaiAPI):
label = "Groq"
url = "https://console.groq.com/playground"
working = True

View File

@ -9,7 +9,7 @@ from ...requests import StreamSession, raise_for_status
from ...errors import MissingAuthError, ResponseError
from ...image import to_data_uri
class Openai(AsyncGeneratorProvider, ProviderModelMixin):
class OpenaiAPI(AsyncGeneratorProvider, ProviderModelMixin):
label = "OpenAI API"
url = "https://platform.openai.com"
working = True

View File

@ -1,9 +1,9 @@
from __future__ import annotations
from .Openai import Openai
from .OpenaiAPI import OpenaiAPI
from ...typing import AsyncResult, Messages
class PerplexityApi(Openai):
class PerplexityApi(OpenaiAPI):
label = "Perplexity API"
url = "https://www.perplexity.ai"
working = True

View File

@ -1,7 +1,7 @@
from __future__ import annotations
from ...typing import CreateResult, Messages
from .Openai import Openai
from .OpenaiAPI import OpenaiAPI
models = {
"theb-ai": "TheB.AI",
@ -27,7 +27,7 @@ models = {
"qwen-7b-chat": "Qwen 7B"
}
class ThebApi(Openai):
class ThebApi(OpenaiAPI):
label = "TheB.AI API"
url = "https://theb.ai"
working = True
@ -58,4 +58,4 @@ class ThebApi(Openai):
"top_p": top_p,
}
}
return super().create_async_generator(model, messages, api_base=api_base, extra_data=data, **kwargs)
return super().create_async_generator(model, messages, api_base=api_base, extra_data=data, **kwargs)

View File

@ -11,7 +11,7 @@ from .GeminiPro import GeminiPro
from .Groq import Groq
from .HuggingFace import HuggingFace
from .MetaAI import MetaAI
from .Openai import Openai
from .OpenaiAPI import OpenaiAPI
from .OpenaiChat import OpenaiChat
from .PerplexityApi import PerplexityApi
from .Poe import Poe