mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-21 12:49:06 +00:00
Implement retry that automatically detect httpx and backoff (#119)
* server: implement retry that automatically detect httpx and backoff Closes #118 * server: fix formatting
This commit is contained in:
@@ -20,6 +20,7 @@ class BananaLLM(LLM):
|
||||
headers=self.headers,
|
||||
json={"prompt": prompt},
|
||||
timeout=self.timeout,
|
||||
retry_timeout=300, # as per their sdk
|
||||
)
|
||||
response.raise_for_status()
|
||||
text = response.json()["text"]
|
||||
|
||||
@@ -21,7 +21,6 @@ class OpenAILLM(LLM):
|
||||
"Authorization": f"Bearer {self.openai_key}",
|
||||
}
|
||||
|
||||
|
||||
async with httpx.AsyncClient(timeout=self.timeout) as client:
|
||||
response = await client.post(
|
||||
self.openai_url,
|
||||
|
||||
Reference in New Issue
Block a user