Skip to content

Model stream error when running in Docker #518

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

Closed
Zeppier opened this issue Apr 15, 2025 · 0 comments · Fixed by #519
Closed

Model stream error when running in Docker #518

Zeppier opened this issue Apr 15, 2025 · 0 comments · Fixed by #519
Labels
bug Something isn't working

Comments

@Zeppier
Copy link

Zeppier commented Apr 15, 2025

Describe the bug

When running agents (simple agent with model gpt-4o-mini) using:

  • OpenAIChatCompletionsModel
  • AsyncOpenAI client

I'm facing next error:
openai.BadRequestError: Error code: 400 - {'error': {'message': "The 'stream_options' parameter is only allowed when 'stream' is enabled.", 'type': 'invalid_request_error', 'param': 'stream_options', 'code': None}}

Actually, not sure if this happens only in docker. I didn't test this outside.

However, this error isn't present in version 0.0.9

Debug information

  • Agents SDK version: 0.0.10
  • Python version Python 3.10

Repro steps

import asyncio

from agents import OpenAIChatCompletionsModel, Agent, Runner
from openai import AsyncOpenAI

from utils.config import config


async def main():
    client = AsyncOpenAI(api_key=config.openai_api_key)
    model = OpenAIChatCompletionsModel(model='gpt-4o-mini', openai_client=client)
    agent = Agent(
        name="Test agent",
        instructions="Test agent",
        model=model
    )
    raw = await Runner.run(
        agent,
        str("test")
    )
    print("Full result of calling '%s': %s", agent.name, raw)



if __name__ == "__main__":
    loop = asyncio.get_event_loop()
    loop.run_until_complete(main())
FROM python:3.10

RUN mkdir -p /test/src
WORKDIR /test/src
COPY requirements.txt /test/src
RUN pip install --no-cache-dir -r requirements.txt 

COPY ./src /test/src

CMD ["python", "main.py"]

Expected behavior

This flow should work without failures

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant