Skip to content

Commit

Permalink
fix: Increase HTTP client timeout from 60s to 600s in function_client…
Browse files Browse the repository at this point in the history
….py and mcp_client.py to enhance request reliability
  • Loading branch information
onuratakan committed Jan 6, 2025
1 parent 22fe860 commit 24e006f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/upsonicai/server/tools/function_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def close(self):

def list_tools(self) -> Dict[str, Any]:
"""List all available tools."""
with httpx.Client(timeout=60.0) as session:
with httpx.Client(timeout=600.0) as session:
response = session.post(f"{self.base_url}/functions/tools")
response.raise_for_status()
return response.json()
Expand All @@ -41,7 +41,7 @@ def call_tool(self, tool_name: str, arguments: Dict[str, Any]) -> Dict[str, Any]
Returns:
Tool execution results
"""
with httpx.Client(timeout=60.0) as session:
with httpx.Client(timeout=600.0) as session:
response = session.post(
f"{self.base_url}/functions/call_tool",
json={"tool_name": tool_name, "arguments": arguments},
Expand Down
4 changes: 2 additions & 2 deletions src/upsonicai/server/tools/mcp_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def close(self):
def list_tools(self) -> Dict[str, Any]:
"""List all available tools."""
# Create a fresh client for each call
with httpx.Client(timeout=60.0) as session:
with httpx.Client(timeout=600.0) as session:
response = session.post(
f"{self.base_url}/mcp/tools",
json={"command": self.command, "args": self.args, "env": self.env},
Expand All @@ -59,7 +59,7 @@ def call_tool(self, tool_name: str, arguments: Dict[str, Any]) -> Dict[str, Any]
Tool execution results
"""
# Create a fresh client for each call
with httpx.Client(timeout=60.0) as session:
with httpx.Client(timeout=600.0) as session:
response = session.post(
f"{self.base_url}/mcp/call_tool",
json={
Expand Down

0 comments on commit 24e006f

Please sign in to comment.