Fix tool server http requests issues (#37)
This commit is contained in:
@@ -320,7 +320,7 @@ class DockerRuntime(AbstractRuntime):
|
|||||||
import httpx
|
import httpx
|
||||||
|
|
||||||
try:
|
try:
|
||||||
async with httpx.AsyncClient() as client:
|
async with httpx.AsyncClient(trust_env=False) as client:
|
||||||
response = await client.post(
|
response = await client.post(
|
||||||
f"{api_url}/register_agent",
|
f"{api_url}/register_agent",
|
||||||
params={"agent_id": agent_id},
|
params={"agent_id": agent_id},
|
||||||
@@ -337,7 +337,7 @@ class DockerRuntime(AbstractRuntime):
|
|||||||
container = self.client.containers.get(container_id)
|
container = self.client.containers.get(container_id)
|
||||||
container.reload()
|
container.reload()
|
||||||
|
|
||||||
host = "localhost"
|
host = "127.0.0.1"
|
||||||
if "DOCKER_HOST" in os.environ:
|
if "DOCKER_HOST" in os.environ:
|
||||||
docker_host = os.environ["DOCKER_HOST"]
|
docker_host = os.environ["DOCKER_HOST"]
|
||||||
if "://" in docker_host:
|
if "://" in docker_host:
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ async def _execute_tool_in_sandbox(tool_name: str, agent_state: Any, **kwargs: A
|
|||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
}
|
}
|
||||||
|
|
||||||
async with httpx.AsyncClient() as client:
|
async with httpx.AsyncClient(trust_env=False) as client:
|
||||||
try:
|
try:
|
||||||
response = await client.post(
|
response = await client.post(
|
||||||
request_url, json=request_data, headers=headers, timeout=None
|
request_url, json=request_data, headers=headers, timeout=None
|
||||||
|
|||||||
Reference in New Issue
Block a user