Add StringableInference provider and update OpenaiTemplate for model retrieval

This commit is contained in:
hlohaus 2025-10-04 12:33:53 +02:00
parent a55256a4c3
commit a18ceac0a5
4 changed files with 38 additions and 6 deletions

View 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)
}