---
type: email
from: Rohan Mehta <notifications@github.com>
subject: Re: [openai/openai-agents-python] Fix #1564 Add conversations API

 support (PR #1587)
received: 2026-03-06 07:16:50
date_header: Thu, 28 Aug 2025 21:26:27 -0700
priority: normal
status: awaiting_approval
uid: 28979
---

## Email Content

**From:** Rohan Mehta <notifications@github.com>
**Subject:** Re: [openai/openai-agents-python] Fix #1564 Add conversations API

 support (PR #1587)
**Date:** Thu, 28 Aug 2025 21:26:27 -0700

### Body (preview)

@rm-openai approved this pull request.







> +        _maybe_openai_client = get_default_openai_client() or AsyncOpenAI()

+    # this never be None here

+    _openai_client: AsyncOpenAI = _maybe_openai_client  # type: ignore [assignment]

+

+    response = await _openai_client.conversations.create(items=[])

+    return response.id

+

+

+_EMPTY_SESSION_ID = ""

+

+

+class OpenAIConversationsSession(SessionABC):

+    def __init__(

+        self,

+        *,

+        session_id: str | None = None,



can you rename to `conversation_id` please?



> +    response = await _openai_client.conversations.create(items=[])

+    return response.id

+

+

+_EMPTY_SESSION_ID = ""

+

+

+class OpenAIConversationsSession(SessionABC):

+    def __init__(

+        self,

+        *,

+        session_id: str | None = None,

+        openai_client: AsyncOpenAI | None = None,

+    ):

+        # this implementation allows to set this value later

+        self.session_id = session_id or _EMPTY_SESSION_ID



a better pattern is:

```

self._session_id: str | None

```



with

```

async def _get_session_id(self) -> str:

  if not self._session_id:

    self._session_id = await ...

  return self._session_id

```

 



> +

+

+class OpenAIConversationsSession(SessionABC):

+    def __init__(

+        self,

+        *,

+        session_id: str | None = None,

+        openai_client: AsyncOpenAI | None = None,

+    ):

+        # this implementation allows to set this value later

+        self.session_id = session_id or _EMPTY_SESSION_ID

+        _openai_client = openai_client

+        if _openai_client is None:

+            _openai_client = get_default_openai_client() or AsyncOpenAI()

+        # this never be None here

+        self.openai_client: AsyncOpenAI = _openai_client



generally prefix with _



-- 

Reply to this email directly or view it on GitHub:

https://github.com/openai/openai-agents-python/pull/1587#pullrequestreview-3167308066

You are rec

---

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