<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Using a data agent in a notebook in Data Science</title>
    <link>https://community.fabric.microsoft.com/t5/Data-Science/Using-a-data-agent-in-a-notebook/m-p/4918695#M1047</link>
    <description>&lt;P&gt;Hi community&lt;/P&gt;&lt;P&gt;Anyone have codesnippet for using a data agent inside a notebook. I found the link below on learn and I do get an answer – however I get warnings that it using functionality that is being depreciated .&lt;/P&gt;&lt;P&gt;I am having a hard time understanding the code. I had hoped the “fabric-data-agent-sdk” might help as this may test answers but I do not see how.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If anyone with a codesnippet for querying data agent in a notebook it would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The warning:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;/tmp/ipykernel_10402/620714472.py:5: DeprecationWarning: The Assistants API is deprecated in favor of the Responses API&lt;/P&gt;&lt;P&gt;&amp;nbsp; thread = fabric_client.beta.threads.create()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Documentation on learn:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/fabric/data-science/data-agent-end-to-end-tutorial" target="_blank"&gt;https://learn.microsoft.com/en-us/fabric/data-science/data-agent-end-to-end-tutorial&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 15 Jan 2026 13:52:36 GMT</pubDate>
    <dc:creator>KimTutein</dc:creator>
    <dc:date>2026-01-15T13:52:36Z</dc:date>
    <item>
      <title>Using a data agent in a notebook</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Science/Using-a-data-agent-in-a-notebook/m-p/4918695#M1047</link>
      <description>&lt;P&gt;Hi community&lt;/P&gt;&lt;P&gt;Anyone have codesnippet for using a data agent inside a notebook. I found the link below on learn and I do get an answer – however I get warnings that it using functionality that is being depreciated .&lt;/P&gt;&lt;P&gt;I am having a hard time understanding the code. I had hoped the “fabric-data-agent-sdk” might help as this may test answers but I do not see how.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If anyone with a codesnippet for querying data agent in a notebook it would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The warning:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;/tmp/ipykernel_10402/620714472.py:5: DeprecationWarning: The Assistants API is deprecated in favor of the Responses API&lt;/P&gt;&lt;P&gt;&amp;nbsp; thread = fabric_client.beta.threads.create()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Documentation on learn:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/fabric/data-science/data-agent-end-to-end-tutorial" target="_blank"&gt;https://learn.microsoft.com/en-us/fabric/data-science/data-agent-end-to-end-tutorial&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jan 2026 13:52:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Science/Using-a-data-agent-in-a-notebook/m-p/4918695#M1047</guid>
      <dc:creator>KimTutein</dc:creator>
      <dc:date>2026-01-15T13:52:36Z</dc:date>
    </item>
    <item>
      <title>Re: Using a data agent in a notebook</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Science/Using-a-data-agent-in-a-notebook/m-p/4918834#M1048</link>
      <description>&lt;P&gt;&amp;nbsp;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="393240" data-lia-user-login="KimTutein" class="lia-mention lia-mention-user"&gt;KimTutein&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You're right — the &lt;STRONG&gt;tutorial&lt;/STRONG&gt; you found on Microsoft Learn uses the &lt;STRONG&gt;deprecated Assistants API&lt;/STRONG&gt;, which is why you're seeing the warning.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Microsoft Fabric has &lt;STRONG&gt;evolved its Data Agent API&lt;/STRONG&gt;, and the recommended SDK (fabric-data-agent-sdk) now uses the &lt;STRONG&gt;Responses API&lt;/STRONG&gt; instead.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Install the latest SDK --&amp;nbsp;!pip install --upgrade fabric-data-agent-sdk&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Updated Code Snippet (using Responses API)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;from fabric_data_agent_sdk import FabricClient&lt;/P&gt;&lt;P&gt;# Authenticate using current Fabric identity (within notebook)&lt;BR /&gt;fabric = FabricClient()&lt;/P&gt;&lt;P&gt;# Your data agent name (must already exist)&lt;BR /&gt;agent_name = "MyAgent"&lt;/P&gt;&lt;P&gt;# Ask a question or send a command&lt;BR /&gt;response = fabric.responses.create(&lt;BR /&gt;data_agent_name=agent_name,&lt;BR /&gt;query="What are the top 5 products by sales?"&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;# Display the response&lt;BR /&gt;print(response.answer)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;This avoids the deprecated .beta.threads.create() syntax.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;The SDK automatically authenticates using the Fabric notebook context (no secrets/tokens needed).&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;The query can be natural language or SQL, depending on your agent configuration.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Make sure you're using the &lt;STRONG&gt;latest SDK methods&lt;/STRONG&gt;, especially since Fabric is still evolving fast.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this post helps, then please appreciate giving a &lt;STRONG&gt;Kudos&lt;/STRONG&gt; or accepting as a &lt;STRONG&gt;Solution&lt;/STRONG&gt; to help the other members find it more quickly.&lt;BR /&gt;If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jan 2026 17:46:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Science/Using-a-data-agent-in-a-notebook/m-p/4918834#M1048</guid>
      <dc:creator>ssrithar</dc:creator>
      <dc:date>2026-01-15T17:46:27Z</dc:date>
    </item>
    <item>
      <title>Re: Using a data agent in a notebook</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Science/Using-a-data-agent-in-a-notebook/m-p/4918937#M1049</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1448111" data-lia-user-login="ssrithar" class="lia-mention lia-mention-user"&gt;ssrithar&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your message&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Install the latest SDK --&lt;/P&gt;&lt;P&gt;!pip install --upgrade fabric-data-agent-sdk&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#This part does not work - I am not sure how to import the FabricClient?&lt;/P&gt;&lt;P&gt;from fabric_data_agent_sdk import FabricClient&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#I tried something like below - however this client&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;from&lt;/SPAN&gt;&lt;SPAN&gt; fabric.dataagent &lt;/SPAN&gt;&lt;SPAN&gt;import&lt;/SPAN&gt;&lt;SPAN&gt; client&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jan 2026 21:16:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Science/Using-a-data-agent-in-a-notebook/m-p/4918937#M1049</guid>
      <dc:creator>KimTutein</dc:creator>
      <dc:date>2026-01-15T21:16:40Z</dc:date>
    </item>
    <item>
      <title>Re: Using a data agent in a notebook</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Science/Using-a-data-agent-in-a-notebook/m-p/4918942#M1050</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="393240" data-lia-user-login="KimTutein" class="lia-mention lia-mention-user"&gt;KimTutein&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;FabricClient &lt;STRONG&gt;does not exist&lt;/STRONG&gt; in any public version of the fabric-data-agent-sdk.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;The import will &lt;STRONG&gt;fail&lt;/STRONG&gt;, and no documented client class exists under that module.&lt;SPAN&gt;The &lt;/SPAN&gt;fabric.responses.create()&lt;SPAN&gt; approach mentioned in the response is from &lt;/SPAN&gt;&lt;STRONG&gt;early preview version.&lt;/STRONG&gt;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Can you try using&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;H3&gt;Use the &lt;STRONG&gt;“Ask a data agent”&lt;/STRONG&gt; cell in a Fabric notebook&lt;/H3&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;No SDK installation or Python imports required&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Fully integrated with Fabric’s identity and workspace context&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Natural language query powered by the configured Data Agent&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Best option for:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;Interacting with Lakehouses, Warehouses, or Semantic Models&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Exploring data using natural language&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;If this post helps, then please appreciate giving a &lt;STRONG&gt;Kudos&lt;/STRONG&gt; or accepting as a &lt;STRONG&gt;Solution&lt;/STRONG&gt; to help the other members find it more quickly.&lt;BR /&gt;If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jan 2026 21:42:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Science/Using-a-data-agent-in-a-notebook/m-p/4918942#M1050</guid>
      <dc:creator>ssrithar</dc:creator>
      <dc:date>2026-01-15T21:42:40Z</dc:date>
    </item>
    <item>
      <title>Re: Using a data agent in a notebook</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Science/Using-a-data-agent-in-a-notebook/m-p/4919077#M1053</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1448111" data-lia-user-login="ssrithar" class="lia-mention lia-mention-user"&gt;ssrithar&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your answer but want I am trying to is to ask a data agent in a notebook which my be schuled. That agent will return an answer in a html format I will send that answer to a user if certain conditions aply. One use case could be something like - "look at this data" - if you find this condition a is true - get some details and put togehter a response I will email the user (then schedule the notebook to run every night)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As far as I know the cell type in Fabric can only be pyspark, spark(scala), sparksql, spark r or HTML - not an option to chat with a data agent. I know there is an option to chat with copilot in a given cell - that is however not the data agent and moreover I need the respons in my pyspark cell during a run to use it.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jan 2026 05:24:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Science/Using-a-data-agent-in-a-notebook/m-p/4919077#M1053</guid>
      <dc:creator>KimTutein</dc:creator>
      <dc:date>2026-01-16T05:24:53Z</dc:date>
    </item>
    <item>
      <title>Re: Using a data agent in a notebook</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Science/Using-a-data-agent-in-a-notebook/m-p/4920749#M1058</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="393240" data-lia-user-login="KimTutein" class="lia-mention lia-mention-user"&gt;KimTutein&lt;/a&gt;,&lt;BR /&gt;Please consider raising a Microsoft support ticket for further investigation. You can explain all the troubleshooting steps you have taken to help them better understand the issue.&lt;BR /&gt;&lt;BR /&gt;You can create a Microsoft support ticket with the help of the link below:&lt;BR /&gt;&lt;A class="" title="https://learn.microsoft.com/en-us/power-bi/support/create-support-ticket" href="https://learn.microsoft.com/en-us/power-bi/support/create-support-ticket" target="_blank" rel="noreferrer noopener" aria-label="Link https://learn.microsoft.com/en-us/power-bi/support/create-support-ticket"&gt;https://learn.microsoft.com/en-us/power-bi/support/create-support-ticket&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jan 2026 11:32:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Science/Using-a-data-agent-in-a-notebook/m-p/4920749#M1058</guid>
      <dc:creator>v-ssriganesh</dc:creator>
      <dc:date>2026-01-19T11:32:19Z</dc:date>
    </item>
  </channel>
</rss>

