This commit is contained in:
2026-07-19 18:57:43 +02:00
parent 48bb6c2ec2
commit c53e2a3319
179 changed files with 9307 additions and 897 deletions
+5 -3
View File
@@ -9,8 +9,8 @@ import re
import time
from dataclasses import dataclass, field
from devplacepy import stealth
from devplacepy.config import INTERNAL_EMBED_MODEL, INTERNAL_EMBED_URL
from devplacepy.services.deepsearch.llm import gateway_client
logger = logging.getLogger(__name__)
@@ -112,13 +112,15 @@ async def embed_texts(
headers = {
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json",
"X-App-Reference": "devplace-deepsearch-v-1-0-0",
}
payload = {"model": INTERNAL_EMBED_MODEL, "input": pending_text}
start = time.monotonic()
backend = "gateway"
try:
async with stealth.stealth_async_client(timeout=EMBED_TIMEOUT_SECONDS) as client:
response = await client.post(gateway_url, json=payload, headers=headers)
response = await gateway_client().post(
gateway_url, json=payload, headers=headers, timeout=EMBED_TIMEOUT_SECONDS
)
if response.status_code >= 400:
raise RuntimeError(f"embed gateway returned {response.status_code}")
data = response.json()