Skip to content

Commit

Permalink
clarify descriptions for timeout & interval, remove debug warning
Browse files Browse the repository at this point in the history
  • Loading branch information
mattf committed Sep 10, 2024
1 parent 95a4233 commit 04bbfc3
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions libs/ai-endpoints/langchain_nvidia_ai_endpoints/_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,16 @@ class Config:
api_key: Optional[SecretStr] = Field(description="API Key for service of choice")

## Generation arguments
timeout: float = Field(60, ge=0, description="Timeout for waiting on response (s)")
interval: float = Field(0.02, ge=0, description="Interval for pulling response")
timeout: float = Field(
60,
ge=0,
description="The minimum amount of time (in sec) to poll after a 202 response",
)
interval: float = Field(
0.02,
ge=0,
description="Interval (in sec) between polling attempts after a 202 response",
)
last_inputs: Optional[dict] = Field(
description="Last inputs sent over to the server"
)
Expand Down Expand Up @@ -383,7 +391,6 @@ def _wait(self, response: Response, session: requests.Session) -> Response:
"NVCF-REQID" in response.headers
), "Received 202 response with no request id to follow"
request_id = response.headers.get("NVCF-REQID")
warnings.warn(f"Polling for response: {request_id}") # todo: remove
payload = {
"url": self.polling_url_tmpl.format(request_id=request_id),
"headers": self.headers_tmpl["call"],
Expand Down

0 comments on commit 04bbfc3

Please sign in to comment.