Add files via upload
This commit is contained in:
1 parent
fb46b5e6a1
commit
067f5289b2
26 files changed
+4189
-3033
No files matched your search
+12
-10
@@ -25,19 +25,21 @@ import tempfile
|
||||
from pathlib import Path
|
||||
from datetime import datetime
|
||||
|
||||
from core.llm_client import call_llm_text as _llm_text
|
||||
def _get_api_key() -> str:
|
||||
config_path = Path(__file__).resolve().parent.parent / "config" / "api_keys.json"
|
||||
with open(config_path, "r", encoding="utf-8") as f:
|
||||
return json.load(f)["gemini_api_key"]
|
||||
|
||||
|
||||
def _gemini_client():
|
||||
# Compatibility shim — returns an object with .generate_content()
|
||||
class _Shim:
|
||||
def generate_content(self, prompt: str) -> "_R":
|
||||
class _R:
|
||||
pass
|
||||
r = _R()
|
||||
r.text = _llm_text(prompt)
|
||||
return r
|
||||
return _Shim()
|
||||
from google import genai
|
||||
_c = genai.Client(api_key=_get_api_key())
|
||||
|
||||
class _W:
|
||||
def generate_content(self, contents):
|
||||
return _c.models.generate_content(model="gemini-2.5-flash", contents=contents)
|
||||
|
||||
return _W()
|
||||
|
||||
|
||||
def _detect_type(path: Path) -> str:
|
||||
|
||||
Reference in new issue
Block a user