Forum Discussion

ann33's avatar
ann33
Helper I
1 year ago
Solved

Fabric Data Agent SDK

 Hi..

Am trying to run Fabric Data Agent SDK. However I am unable to proceed due to the below error. There is no documentation post the migration Assistant API.Can someone help to guide on the correct method to call.

 

AttributeError: 'FabricOpenAI' object has no attribute 'list_messages'
-------------------------------------------------------
import sempy.fabric as fabric
from fabric.dataagent.client import FabricOpenAI

# Initialize the FabricOpenAI client
fabric_client = FabricOpenAI(artifact_name=ai_skill_name)

# Assume there is a method to list messages
# Note: The actual method name should be verified with the library documentation
response = fabric_client.list_messages(
    thread_id=thread.id,
    sort_order="asc"
)

# Print the response in a structured JSON format
print(response.model_dump_json(indent=2))
  • Hi ann33 

     

     

    The `FabricOpenAI` client does not have a direct `list_messages()` method.  the correct way to list messages is to use the thread-based message listing pattern from the OpenAI Assistants API

     

    Give this a try :

     

     

    from fabric.dataagent.client import FabricOpenAI


    fabric_client = FabricOpenAI(artifact_name=ai_skill_name)


    response = fabric_client.beta.threads.messages.list(
    thread_id=thread.id,
    order="asc" 
    )


    print(response.model_dump_json(indent=2))

  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi ann33 ,

    Thank you for reaching out to the Microsoft Fabric Community and thank you nilendraFabric for sharing the helpful response.

     

    The warning you’re seeing is from the openai Python package, which flags that the Assistants API will eventually be replaced by the Responses API. However, it remains fully supported and will be available until at least mid-2026, with a 12-month notice before deprecation.

    As of now, the Fabric Data Agent SDK supports only the Assistants API. The correct method:

    fabric_client.beta.threads.messages.list(thread_id=thread.id, order="asc")
    

    is still valid and safe to use.

    If you'd prefer to remove the warning, you can suppress it using:

    import warnings
    warnings.filterwarnings("ignore", category=DeprecationWarning)
    

    Support for the Responses API in Fabric will come in a future update. Meanwhile, you're good to proceed with the current SDK.

     

    Hope this helps. Please reach out for further assistance.

    If this post helps, then please consider to Accept as the solution to help the other members find it more quickly and a kudos would be appreciated.

     

    Thank you.

4 Replies

  • Hi ann33 

     

     

    The `FabricOpenAI` client does not have a direct `list_messages()` method.  the correct way to list messages is to use the thread-based message listing pattern from the OpenAI Assistants API

     

    Give this a try :

     

     

    from fabric.dataagent.client import FabricOpenAI


    fabric_client = FabricOpenAI(artifact_name=ai_skill_name)


    response = fabric_client.beta.threads.messages.list(
    thread_id=thread.id,
    order="asc" 
    )


    print(response.model_dump_json(indent=2))

    • ann33's avatar
      ann33
      Helper I

      Thank You.

      Now facing the below.

       

      DeprecationWarning: The Assistants API is deprecated in favor of the Responses API

      Does the SDK support Responses API

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi ann33 ,

    Thank you for reaching out to the Microsoft Fabric Community and thank you nilendraFabric for sharing the helpful response.

     

    The warning you’re seeing is from the openai Python package, which flags that the Assistants API will eventually be replaced by the Responses API. However, it remains fully supported and will be available until at least mid-2026, with a 12-month notice before deprecation.

    As of now, the Fabric Data Agent SDK supports only the Assistants API. The correct method:

    fabric_client.beta.threads.messages.list(thread_id=thread.id, order="asc")
    

    is still valid and safe to use.

    If you'd prefer to remove the warning, you can suppress it using:

    import warnings
    warnings.filterwarnings("ignore", category=DeprecationWarning)
    

    Support for the Responses API in Fabric will come in a future update. Meanwhile, you're good to proceed with the current SDK.

     

    Hope this helps. Please reach out for further assistance.

    If this post helps, then please consider to Accept as the solution to help the other members find it more quickly and a kudos would be appreciated.

     

    Thank you.