File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -47,7 +47,9 @@ def __init__(self) -> None:
4747 self .headers = {"Authorization" : f"Bearer { get_codeflash_api_key ()} " , "Connection" : "close" }
4848 self .llm_call_counter = count (1 )
4949 self .is_local = self .base_url == "http://localhost:8000"
50- self .timeout : float | None = 300 if self .is_local else 90
50+ # (connect_timeout, read_timeout) — connect should be fast; read
51+ # can be slow because the server runs LLM inference.
52+ self .timeout : float | tuple [float , float ] | None = (10 , 300 )
5153
5254 def get_next_sequence (self ) -> int :
5355 """Get the next LLM call sequence number."""
@@ -88,7 +90,7 @@ def make_ai_service_request(
8890 endpoint : str ,
8991 method : str = "POST" ,
9092 payload : dict [str , Any ] | list [dict [str , Any ]] | None = None ,
91- timeout : float | None = None ,
93+ timeout : float | tuple [ float , float ] | None = None ,
9294 ) -> requests .Response :
9395 """Make an API request to the given endpoint on the AI service.
9496
You can’t perform that action at this time.
0 commit comments