openai-python icon indicating copy to clipboard operation
openai-python copied to clipboard

Chatkit

Open chunshengding opened this issue 5 months ago • 1 comments

Confirm this is a feature request for the Python library and not the underlying OpenAI API.

  • [x] This is a feature request for the Python library

Describe the feature or improvement you're requesting

I haven't seen any ChatKit-related content in the latest updates. We've built a workflow for our enterprise application in Agent Builder. According to the official documentation, I'm using the latest OpenAI package for Python, version 2.3.0, which doesn't yet support ChatKit. I'm getting an error on the line "session = openai.chatkit.sessions.create" (no chatkit attribute).

Reference official documentation: https://platform.openai.com/docs/guides/chatkit#2-set-up-chatkit-in-your-product

How can I resolve this issue or integrate it? Thank you.

Additional context

No response

chunshengding avatar Oct 13 '25 03:10 chunshengding

As a workaround we integrated through OpenAI's API @chunshengding

Sample request:

        headers = {
            "Content-Type": "application/json",
            "OpenAI-Beta": "chatkit_beta=v1",
            "Authorization": f"Bearer {self.api_key}",
        }

        body = {
            "workflow": {"id": self.workflow_id},
            "user": user_id,
        }

        response = requests.post(self.base_url, headers=headers, json=body, timeout=self.timeout_seconds)

The lack of that function the main library althrough mentioned at official docs is confusing.

log4b avatar Oct 13 '25 18:10 log4b