mirror of
https://github.com/xtekky/gpt4free.git
synced 2025-12-15 14:51:19 -08:00
Add StringableInference provider and update OpenaiTemplate for model retrieval
This commit is contained in:
parent
a55256a4c3
commit
a18ceac0a5
4 changed files with 38 additions and 6 deletions
31
g4f/Provider/StringableInference.py
Normal file
31
g4f/Provider/StringableInference.py
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import secrets
|
||||
import string
|
||||
|
||||
from .template import OpenaiTemplate
|
||||
|
||||
class StringableInference(OpenaiTemplate):
|
||||
label = "Stringable Inference"
|
||||
url = "https://stringable-inference.onrender.com"
|
||||
api_base = "https://stringableinf.com/api"
|
||||
api_endpoint = "https://stringableinf.com/api/v1/chat/completions"
|
||||
|
||||
working = True
|
||||
active_by_default = True
|
||||
default_model = "deepseek-v3.2"
|
||||
default_vision_model = "gpt-oss-120b"
|
||||
|
||||
@classmethod
|
||||
def get_headers(cls, stream: bool, api_key: str = None, headers: dict = None) -> dict:
|
||||
return {
|
||||
"Accept": "text/event-stream" if stream else "application/json",
|
||||
"Content-Type": "application/json",
|
||||
"HTTP-Referer": "https://g4f.dev/",
|
||||
"X-Title": "G4F Python",
|
||||
**(
|
||||
{"Authorization": f"Bearer {api_key}"}
|
||||
if api_key else {}
|
||||
),
|
||||
**({} if headers is None else headers)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue