Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The output panel shows "Request failed" after the task is completed #157

Open
ynywna opened this issue Mar 14, 2025 · 4 comments
Open

The output panel shows "Request failed" after the task is completed #157

ynywna opened this issue Mar 14, 2025 · 4 comments
Labels
question Question about using the SDK

Comments

@ynywna
Copy link

ynywna commented Mar 14, 2025

Please read this first

  • Have you read the docs?Agents SDK docs
  • Have you searched for related issues? Others may have had similar requesrs

Question

The model is started using vllm, and the task uses to_input_list. After the task is completed, it still outputs Request failed.

@ynywna ynywna added the question Question about using the SDK label Mar 14, 2025
@ynywna
Copy link
Author

ynywna commented Mar 14, 2025

Code and Output

Code

from agents import Agent, Runner, AsyncOpenAI, OpenAIChatCompletionsModel, set_default_openai_client, trace
import asyncio

vllm_client = AsyncOpenAI(
    api_key="EMPTY",
    base_url="http://121.61.42.5:7744/v1"
)
set_default_openai_client(vllm_client)

async def conversation_agent():
    agent = Agent(
        name="ConversationAgent",
        model=OpenAIChatCompletionsModel(
            model="qwen",
            openai_client=vllm_client,
        ),
        instructions="Please answer the questions very concisely in an American context."
    )
    result = await Runner.run(agent, input="Where is Central Park located?")
    print(result.final_output)

    new_input = result.to_input_list() + [
        {"role": "user", "content": "Please describe the lifestyle in New York City."},
    ]
    result = await Runner.run(agent, input=new_input)
    print(result.final_output)

if __name__ == "__main__":
    asyncio.run(conversation_agent())

###Output:

Central Park is located in Manhattan, New York City.

New York City lifestyle is fast-paced, diverse, and energetic. It combines bustling streets, endless entertainment, world-class cuisine, and a 24-hour subway. Residents often prioritize career and social life, embracing the city’s vibrant cultural scene and varied neighborhoods.

Request failed: [Errno 101] Network is unreachable

Request failed: [Errno 101] Network is unreachable

Request failed: [Errno 101] Network is unreachable

Max retries reached, giving up on this batch.

@moseshu
Copy link

moseshu commented Mar 14, 2025

from agents import set_tracing_disabled
set_tracing_disabled(True)

or 
with trace("test"):
   await Runner.run(agent, input="Where is Central Park located?")
......

read the doc https://openai.github.io/openai-agents-python/config/

@ynywna
Copy link
Author

ynywna commented Mar 14, 2025

Thanks, I used set_tracing_disabled(True) to solve the problem, but using trace("test") alone still causes the same issue

@litaolaile
Copy link

Image ,i have another problem

from agents import set_tracing_disabled
set_tracing_disabled(True)

or
with trace("test"):
await Runner.run(agent, input="Where is Central Park located?")
......
read the doc https://openai.github.io/openai-agents-python/config/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question about using the SDK
Projects
None yet
Development

No branches or pull requests

3 participants