[Python] How to create an OpenAI Assistant using Responses API

Discussão em 'Python' iniciado por Stack, Julho 2, 2025.

  1. Stack

    Stack Membro Participativo

    When I try using Python Azure OpenAI SDK to create a thread for my OpenAI Assistant

    my_thread = azure_openai_client.beta.threads.create()


    , it works but the following annoying error is shown:


    /tmp/ipykernel_1880725/4229537171.py:1: DeprecationWarning: The Assistants API is deprecated in favor of the Responses API my_thread = azure_openai_client.beta.threads.create()
    ​

    [​IMG]

    So I went to the OpenAI documentation page at https://platform.openai.com/docs/assistants/quickstart, where it actually says that they incorporated key improvements into the Responses API: [​IMG]

    However I can't find any way to create the assistant or the thread, using Responses API's: even OpenAI documentation on the same page above shows how to do this with the "deprecated" method.

    Of course I know how to disable the warning, but I'm wondering why I'm receiving it: I expect to receive a warning right after an alternative (even in preview) is available, but not earlier.

    Continue reading...

Compartilhe esta Página