---
type: email
from: Abdul Samad Siddiqui <notifications@github.com>
subject: Re: [openai/openai-agents-python] examples: make

 function-call-streaming example safer (dataclass + safer attribute access +

 instruction fix) (PR #1794)
received: 2026-03-06 07:42:44
date_header: Wed, 24 Sep 2025 00:54:18 -0700
priority: normal
status: awaiting_approval
uid: 31201
---

## Email Content

**From:** Abdul Samad Siddiqui <notifications@github.com>
**Subject:** Re: [openai/openai-agents-python] examples: make

 function-call-streaming example safer (dataclass + safer attribute access +

 instruction fix) (PR #1794)
**Date:** Wed, 24 Sep 2025 00:54:18 -0700

### Body (preview)

AbdulSamad94 left a comment (openai/openai-agents-python#1794)



@seratch thanks for the review!

Just to share some testing context: with the current instructions of CodeGenerator Agent the example **fails on Gemini (and a few other models)** because the model sometimes triggers **two function\_call items at once**, which leads to a 400 error like this:



```

openai.BadRequestError: Error code: 400 - [{'error': {'code': 400, 'message': 'Request contains an invalid argument.', 'status': 'INVALID_ARGUMENT'}}]

```



Even a minimal run like:



```

uv run stream_function_call_args.py

```



shows overlapping calls:



```

{"dependencies":["fastapi","uvicorn"],"project_name":"my-app","version":"1.0.0"}

{"content":"...","filename":"main.py"}

```



The main issue is the instruction text, if we **tighten it slightly** (e.g. “Strictly call one tool at a time; wait for the previous call to finish before starting the next”) it runs fine on Gemini and OpenAI models.



Would you be open to a very small follow-up PR that *only* updates the instructions in the example so it’s model-agnostic, without the extra type-safety changes?





-- 

Reply to this email directly or view it on GitHub:

https://github.com/openai/openai-agents-python/pull/1794#issuecomment-3327073172

You are receiving this because you are subscribed to this thread.



Message ID: <openai/openai-agents-python/pull/1794/c3327073172@github.com>

---

## Suggested Actions
- [ ] Reply
- [ ] Archive
- [ ] Escalate
