agent-lightning
agent-lightning copied to clipboard
[BUG] Error uploading logfile: POST request failed: HTTPConnectionPool(host='localhost', port=`RANDOM PORT`)
An error happens when we execute:
import os
from agentlightning import Trainer, DevTaskLoader, LLM
from calc_agent import CalcAgent
def dev_task_loader() -> DevTaskLoader:
return DevTaskLoader(
tasks=[
{
"question": "What is 2 + 2?",
"result": "4",
},
{
"question": "What is 3 * 5?",
"result": "15",
},
{
"question": "What is the square root of 16?",
"result": "4",
},
],
resources={
"main_llm": LLM(
endpoint="https://api.openai.com/v1", model="gpt-4.1-nano", sampling_parameters={"temperature": 0.7}
),
},
)
if __name__ == "__main__":
Trainer(n_workers=1, dev=True, max_tasks=2).fit(CalcAgent(), "http://localhost:9998/", dev_task_loader())
port can be different.
🖇 AgentOps: [agentops.InternalSpanProcessor] Error uploading logfile: POST request failed: HTTPConnectionPool(host='localhost', port=57781): Max retries exceeded with url: /v4/logs/upload/ (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f0e63557d60>: Failed to establish a new connection: [Errno 111] Connection refused'))
🖇 AgentOps: Session Replay for default.session trace: http://localhost:57781/notavailable/sessions?trace_id=6cb23a64f31ca07dd09b8dc042c7b539
openai version is 1.99.9
The error can be safely ignored. We might address this in future.
#30