<?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 Re: AI Skill works using UI but doesn't work when calling programmatically in Data Science</title>
    <link>https://community.fabric.microsoft.com/t5/Data-Science/AI-Skill-works-using-UI-but-doesn-t-work-when-calling/m-p/4291991#M549</link>
    <description>&lt;P&gt;I have the same issue, the difference I see is the trailing NaN in the URL, is it by design?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 19 Nov 2024 22:55:52 GMT</pubDate>
    <dc:creator>ighosh</dc:creator>
    <dc:date>2024-11-19T22:55:52Z</dc:date>
    <item>
      <title>AI Skill works using UI but doesn't work when calling programmatically</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Science/AI-Skill-works-using-UI-but-doesn-t-work-when-calling/m-p/4282887#M546</link>
      <description>&lt;P&gt;I am trying to debug the Python code that a colleague wrote following the example given here:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A title="https://learn.microsoft.com/en-us/fabric/data-science/ai-skill-scenario#use-the-ai-skill-programmatically" href="https://learn.microsoft.com/en-us/fabric/data-science/ai-skill-scenario#use-the-ai-skill-programmatically" target="_blank" rel="noreferrer noopener"&gt;https://learn.microsoft.com/en-us/fabric/data-science/ai-skill-scenario#use-the-ai-skill-programmatically&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A title="https://learn.microsoft.com/en-us/fabric/data-science/ai-skill-scenario#use-the-ai-skill-programmatically" href="https://learn.microsoft.com/en-us/fabric/data-science/ai-skill-scenario#use-the-ai-skill-programmatically" target="_blank" rel="noopener noreferrer"&gt;the code is really simple. &amp;nbsp;We just plugged in our URL and question and ran it. &amp;nbsp;Here is the code:&lt;/A&gt;&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;LI-CODE lang="python"&gt;import requests
import json
import pprint
from synapse.ml.mlflow import get_mlflow_env_config


# the URL could change if the workspace is assigned to a different capacity
url = "https://msitapi.fabric.microsoft.com/v1/workspaces/65c73be1-bfdf-4683-812e-cab91cc98cbeNaN"

configs = get_mlflow_env_config()

headers = {
    "Authorization": f"Bearer {configs.driver_aad_token}",
    "Content-Type": "application/json; charset=utf-8"
}

#print (configs)
#question = "{userQuestion: \"Please list all providers\"}"
question = "{userQuestion: \"Please give me total number of claims in the claims.csv table\"}"
# question = "{userQuestion: \"Could you give me total cost of procedures done in year 2023 grouped by procedure code?\"}"

response = requests.post(url, headers=headers, data = question)
print ("I am here now")

print("RESPONSE: ", response)

#print("")

responsebody = json.loads(response.content)

print (responsebody)

#print(response["result"])&lt;/LI-CODE&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;P&gt;&lt;A title="https://learn.microsoft.com/en-us/fabric/data-science/ai-skill-scenario#use-the-ai-skill-programmatically" href="https://learn.microsoft.com/en-us/fabric/data-science/ai-skill-scenario#use-the-ai-skill-programmatically" target="_blank" rel="noreferrer noopener"&gt;&amp;nbsp;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A title="https://learn.microsoft.com/en-us/fabric/data-science/ai-skill-scenario#use-the-ai-skill-programmatically" href="https://learn.microsoft.com/en-us/fabric/data-science/ai-skill-scenario#use-the-ai-skill-programmatically" target="_blank" rel="noreferrer noopener"&gt;Here is the response:&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A title="https://learn.microsoft.com/en-us/fabric/data-science/ai-skill-scenario#use-the-ai-skill-programmatically" href="https://learn.microsoft.com/en-us/fabric/data-science/ai-skill-scenario#use-the-ai-skill-programmatically" target="_blank" rel="noreferrer noopener"&gt;&lt;SPAN&gt;I am here now&lt;BR /&gt;&lt;SPAN&gt;RESPONSE:&amp;nbsp; &amp;lt;Response [405]&amp;gt;&lt;BR /&gt;&lt;SPAN&gt;{'requestId': '9c739b23-d366-4c71-8fe2-4107e09cbf29', 'errorCode': 'UnknownError', 'message': 'An error occurred while processing the operation'}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A title="https://learn.microsoft.com/en-us/fabric/data-science/ai-skill-scenario#use-the-ai-skill-programmatically" href="https://learn.microsoft.com/en-us/fabric/data-science/ai-skill-scenario#use-the-ai-skill-programmatically" target="_blank" rel="noreferrer noopener"&gt;&amp;nbsp;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A title="https://learn.microsoft.com/en-us/fabric/data-science/ai-skill-scenario#use-the-ai-skill-programmatically" href="https://learn.microsoft.com/en-us/fabric/data-science/ai-skill-scenario#use-the-ai-skill-programmatically" target="_blank" rel="noreferrer noopener"&gt;&lt;SPAN&gt;the log shows no errors. &amp;nbsp;How do we go about debugging this script. &amp;nbsp;If anyone can help, that would be great.&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Nov 2025 15:49:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Science/AI-Skill-works-using-UI-but-doesn-t-work-when-calling/m-p/4282887#M546</guid>
      <dc:creator>bruparel</dc:creator>
      <dc:date>2025-11-18T15:49:09Z</dc:date>
    </item>
    <item>
      <title>Re: AI Skill works using UI but doesn't work when calling programmatically</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Science/AI-Skill-works-using-UI-but-doesn-t-work-when-calling/m-p/4283227#M547</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="847544" data-lia-user-login="bruparel" class="lia-mention lia-mention-user"&gt;bruparel&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;I check the error message and I found it means the request method not allowed, you may need to check the api document to use allow methods to send these requests.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/405" target="_self"&gt;405 Method Not Allowed&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Xiaoxin Sheng&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2024 06:55:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Science/AI-Skill-works-using-UI-but-doesn-t-work-when-calling/m-p/4283227#M547</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-14T06:55:00Z</dc:date>
    </item>
    <item>
      <title>Re: AI Skill works using UI but doesn't work when calling programmatically</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Science/AI-Skill-works-using-UI-but-doesn-t-work-when-calling/m-p/4291991#M549</link>
      <description>&lt;P&gt;I have the same issue, the difference I see is the trailing NaN in the URL, is it by design?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Nov 2024 22:55:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Science/AI-Skill-works-using-UI-but-doesn-t-work-when-calling/m-p/4291991#M549</guid>
      <dc:creator>ighosh</dc:creator>
      <dc:date>2024-11-19T22:55:52Z</dc:date>
    </item>
  </channel>
</rss>

