返回提交历史
Modified
docs/providers-and-models.md
+0
-1
Deleted
g4f/Provider/AiMathGPT.py
+0
-74
Modified
g4f/Provider/__init__.py
+0
-1
Modified
g4f/models.py
+1
-3
XFEstudio/gpt4free
Removed provider (g4f/Provider/AiMathGPT.py)
618bb78f
代码差异
4 个文件
+1
-79
@@ -19,7 +19,6 @@ This document provides an overview of various AI providers and models, including
19
19
|----------|-------------|--------------|---------------|--------|--------|------|
20
20
|[ai4chat.co](https://www.ai4chat.co)|`g4f.Provider.Ai4Chat`|`gpt-4`|❌|❌|✔||❌|
21
21
|[aichatfree.info](https://aichatfree.info)|`g4f.Provider.AIChatFree`|`gemini-pro`|❌|❌|✔||❌|
22
|[aimathgpt.forit.ai](https://aimathgpt.forit.ai)|`g4f.Provider.AiMathGPT`|`llama-3.1-70b`|❌|❌|✔||❌|
23
22
|[api.airforce](https://api.airforce)|`g4f.Provider.Airforce`|`gpt-4o, gpt-4o-mini, gpt-4-turbo, llama-2-7b, llama-3.1-8b, llama-3.1-70b, hermes-2-pro, hermes-2-dpo, phi-2, deepseek-coder, openchat-3.5, openhermes-2.5, lfm-40b, german-7b, zephyr-7b, neural-7b`|`flux, flux-realism', flux-anime, flux-3d, flux-disney, flux-pixel, flux-4o, any-dark, sdxl`|❌|✔||❌|
24
23
|[aiuncensored.info](https://www.aiuncensored.info)|`g4f.Provider.AIUncensored`|✔|✔|❌|✔||❌|
25
24
|[allyfy.chat](https://allyfy.chat/)|`g4f.Provider.Allyfy`|`gpt-3.5-turbo`|❌|❌|✔||❌|
@@ -1,74 +0,0 @@
1
from __future__ import annotations
2
3
from aiohttp import ClientSession
4
5
from ..typing import AsyncResult, Messages
6
from .base_provider import AsyncGeneratorProvider, ProviderModelMixin
7
from .helper import format_prompt
8
9
class AiMathGPT(AsyncGeneratorProvider, ProviderModelMixin):
10
url = "https://aimathgpt.forit.ai"
11
api_endpoint = "https://aimathgpt.forit.ai/api/ai"
12
working = True
13
supports_stream = False
14
supports_system_message = True
15
supports_message_history = True
16
17
default_model = 'llama3'
18
models = ['llama3']
19
20
model_aliases = {"llama-3.1-70b": "llama3",}
21
22
@classmethod
23
def get_model(cls, model: str) -> str:
24
if model in cls.models:
25
return model
26
elif model in cls.model_aliases:
27
return cls.model_aliases[model]
28
else:
29
return cls.default_model
30
31
@classmethod
32
async def create_async_generator(
33
cls,
34
model: str,
35
messages: Messages,
36
proxy: str = None,
37
**kwargs
38
) -> AsyncResult:
39
model = cls.get_model(model)
40
41
headers = {
42
'accept': '*/*',
43
'accept-language': 'en-US,en;q=0.9',
44
'cache-control': 'no-cache',
45
'content-type': 'application/json',
46
'origin': cls.url,
47
'pragma': 'no-cache',
48
'priority': 'u=1, i',
49
'referer': f'{cls.url}/',
50
'sec-ch-ua': '"Chromium";v="129", "Not=A?Brand";v="8"',
51
'sec-ch-ua-mobile': '?0',
52
'sec-ch-ua-platform': '"Linux"',
53
'sec-fetch-dest': 'empty',
54
'sec-fetch-mode': 'cors',
55
'sec-fetch-site': 'same-origin',
56
'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36'
57
}
58
59
async with ClientSession(headers=headers) as session:
60
data = {
61
"messages": [
62
{
63
"role": "user",
64
"content": format_prompt(messages)
65
}
66
],
67
"model": model
68
}
69
70
async with session.post(cls.api_endpoint, json=data, proxy=proxy) as response:
71
response.raise_for_status()
72
response_data = await response.json()
73
filtered_response = response_data['result']['response']
74
yield filtered_response
@@ -13,7 +13,6 @@ from .local import *
13
13
14
14
from .AIUncensored import AIUncensored
15
15
from .Allyfy import Allyfy
16
from .AiMathGPT import AiMathGPT
17
16
from .Airforce import Airforce
18
17
from .Bing import Bing
19
18
from .Blackbox import Blackbox
@@ -6,7 +6,6 @@ from .Provider import IterListProvider, ProviderType
6
6
from .Provider import (
7
7
Ai4Chat,
8
8
AIChatFree,
9
AiMathGPT,
10
9
Airforce,
11
10
AIUncensored,
12
11
Allyfy,
@@ -81,7 +80,6 @@ default = Model(
81
80
ChatGptEs,
82
81
ChatifyAI,
83
82
Cloudflare,
84
AiMathGPT,
85
83
AIUncensored,
86
84
DarkAI,
87
85
])
@@ -184,7 +182,7 @@ llama_3_1_8b = Model(
184
182
llama_3_1_70b = Model(
185
183
name = "llama-3.1-70b",
186
184
base_provider = "Meta Llama",
187
best_provider = IterListProvider([DDG, DeepInfraChat, Blackbox, TeachAnything, DarkAI, AiMathGPT, Airforce, RubiksAI, HuggingChat, HuggingFace, PerplexityLabs])
185
best_provider = IterListProvider([DDG, DeepInfraChat, Blackbox, TeachAnything, DarkAI, Airforce, RubiksAI, HuggingChat, HuggingFace, PerplexityLabs])
188
186
)
189
187
190
188
llama_3_1_405b = Model(