<?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 Issue with Lang Chain Agents in Generative AI</title>
    <link>https://community.databricks.com/t5/generative-ai/issue-with-lang-chain-agents/m-p/105165#M692</link>
    <description>&lt;P&gt;This is regarding Agentic framework. We are getting issues while invoking the lang chain agent and need your help to get some suggestions from your expert team to resolve this.&lt;/P&gt;&lt;P&gt;As per our observation Agent is behaving bit weird while calling tools registered in UC :&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial black,avant garde"&gt;Code Snippet :&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="andale mono,times"&gt;&lt;EM&gt;prompt = get_prompt()&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="andale mono,times"&gt;&lt;EM&gt;tools = get_tools()&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="andale mono,times"&gt;&lt;EM&gt;agent = create_openai_tools_agent(llm, tools, prompt)&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="andale mono,times"&gt;&lt;EM&gt;agent_executor = AgentExecutor(agent=agent, tools=tools, verbose=True)&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="andale mono,times"&gt;&lt;EM&gt;agent_str = ({ "messages": itemgetter("messages")} | agent_executor | itemgetter("output") | StrOutputParser())&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;If the user prompt/demands can be fulfilled with invoking a single tool&amp;nbsp; (&lt;FONT color="#00FF00"&gt; successful&lt;/FONT&gt; )&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SandipCoder_0-1736512522115.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/14042i1B36A9BC224DA2AE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SandipCoder_0-1736512522115.png" alt="SandipCoder_0-1736512522115.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;2. But if the user input demands chaining of tools to be invoked ,sometimes it’s throwing the following error. ( &lt;FONT color="#FF0000"&gt;Error&lt;/FONT&gt; )[ But in some run the same code is working and returning valid output]&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SandipCoder_1-1736512522122.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/14043i60F4082600872A31/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SandipCoder_1-1736512522122.png" alt="SandipCoder_1-1736512522122.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Cluster Used :&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;ML Cluster runtime 15.4&lt;/LI&gt;&lt;LI&gt;SQl Warehouse&lt;/LI&gt;&lt;/OL&gt;</description>
    <pubDate>Fri, 10 Jan 2025 12:38:23 GMT</pubDate>
    <dc:creator>SandipCoder</dc:creator>
    <dc:date>2025-01-10T12:38:23Z</dc:date>
    <item>
      <title>Issue with Lang Chain Agents</title>
      <link>https://community.databricks.com/t5/generative-ai/issue-with-lang-chain-agents/m-p/105165#M692</link>
      <description>&lt;P&gt;This is regarding Agentic framework. We are getting issues while invoking the lang chain agent and need your help to get some suggestions from your expert team to resolve this.&lt;/P&gt;&lt;P&gt;As per our observation Agent is behaving bit weird while calling tools registered in UC :&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial black,avant garde"&gt;Code Snippet :&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="andale mono,times"&gt;&lt;EM&gt;prompt = get_prompt()&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="andale mono,times"&gt;&lt;EM&gt;tools = get_tools()&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="andale mono,times"&gt;&lt;EM&gt;agent = create_openai_tools_agent(llm, tools, prompt)&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="andale mono,times"&gt;&lt;EM&gt;agent_executor = AgentExecutor(agent=agent, tools=tools, verbose=True)&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="andale mono,times"&gt;&lt;EM&gt;agent_str = ({ "messages": itemgetter("messages")} | agent_executor | itemgetter("output") | StrOutputParser())&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;If the user prompt/demands can be fulfilled with invoking a single tool&amp;nbsp; (&lt;FONT color="#00FF00"&gt; successful&lt;/FONT&gt; )&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SandipCoder_0-1736512522115.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/14042i1B36A9BC224DA2AE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SandipCoder_0-1736512522115.png" alt="SandipCoder_0-1736512522115.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;2. But if the user input demands chaining of tools to be invoked ,sometimes it’s throwing the following error. ( &lt;FONT color="#FF0000"&gt;Error&lt;/FONT&gt; )[ But in some run the same code is working and returning valid output]&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SandipCoder_1-1736512522122.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/14043i60F4082600872A31/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SandipCoder_1-1736512522122.png" alt="SandipCoder_1-1736512522122.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Cluster Used :&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;ML Cluster runtime 15.4&lt;/LI&gt;&lt;LI&gt;SQl Warehouse&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Fri, 10 Jan 2025 12:38:23 GMT</pubDate>
      <guid>https://community.databricks.com/t5/generative-ai/issue-with-lang-chain-agents/m-p/105165#M692</guid>
      <dc:creator>SandipCoder</dc:creator>
      <dc:date>2025-01-10T12:38:23Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Lang Chain Agents</title>
      <link>https://community.databricks.com/t5/generative-ai/issue-with-lang-chain-agents/m-p/105186#M693</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/118624"&gt;@SandipCoder&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;About point 2, is it working intermittently or failing all the time?&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jan 2025 14:14:00 GMT</pubDate>
      <guid>https://community.databricks.com/t5/generative-ai/issue-with-lang-chain-agents/m-p/105186#M693</guid>
      <dc:creator>Alberto_Umana</dc:creator>
      <dc:date>2025-01-10T14:14:00Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Lang Chain Agents</title>
      <link>https://community.databricks.com/t5/generative-ai/issue-with-lang-chain-agents/m-p/114709#M829</link>
      <description>&lt;P&gt;Thanks Alberto ....I found that as a workspace issue ..&lt;/P&gt;</description>
      <pubDate>Mon, 07 Apr 2025 11:40:41 GMT</pubDate>
      <guid>https://community.databricks.com/t5/generative-ai/issue-with-lang-chain-agents/m-p/114709#M829</guid>
      <dc:creator>SandipCoder</dc:creator>
      <dc:date>2025-04-07T11:40:41Z</dc:date>
    </item>
  </channel>
</rss>

