<?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: How to deploy an agent into model registry using MLFlow in Generative AI</title>
    <link>https://community.databricks.com/t5/generative-ai/how-to-deploy-an-agent-into-model-registry-using-mlflow/m-p/114703#M827</link>
    <description>&lt;P&gt;Please go though this&amp;nbsp; :&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.databricks.com/aws/en/machine-learning/model-serving/custom-models" target="_blank"&gt;https://docs.databricks.com/aws/en/machine-learning/model-serving/custom-models&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 07 Apr 2025 11:05:00 GMT</pubDate>
    <dc:creator>SandipCoder</dc:creator>
    <dc:date>2025-04-07T11:05:00Z</dc:date>
    <item>
      <title>How to deploy an agent into model registry using MLFlow</title>
      <link>https://community.databricks.com/t5/generative-ai/how-to-deploy-an-agent-into-model-registry-using-mlflow/m-p/87172#M488</link>
      <description>&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Goal :&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;Here below I am attaching my code snippet where I am trying to build an agent on my custom functions .Things are working well when I am running agent.invoke(“Question”).&lt;BR /&gt;But now I want to deploy this agent into model registry using MLFlow but I am not able to . I have explored many databricks blogs but all of them ended up with deploying model and chain only.&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;SampleCode:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2" color="#993300"&gt;agent_name='PolicyStar_Agent'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#993300"&gt;agent_version = "1.0"&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="2" color="#993300"&gt;def multiply(a: int, b: int) -&amp;gt; int:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#993300"&gt;"""Multiply two numbers."""&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#993300"&gt;return a * b&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="2" color="#993300"&gt;tools = [&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#993300"&gt;StructuredTool.from_function(func=multiply),&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#993300"&gt;StructuredTool.from_function(func=Fn_query_from_unstructured_data),&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#993300"&gt;StructuredTool.from_function(func=Fn_query_from_structured_data),&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#993300"&gt;StructuredTool.from_function(func=Fn_executesql_from_structured_data)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#993300"&gt;]&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="2" color="#993300"&gt;agent = initialize_agent(&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#993300"&gt;agent_name=agent_name,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#993300"&gt;tools=tools,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#993300"&gt;llm=llm,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#993300"&gt;agent=AgentType.STRUCTURED_CHAT_ZERO_SHOT_REACT_DESCRIPTION,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#993300"&gt;verbose=True&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#993300"&gt;)&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="2" color="#993300"&gt;response = agent.invoke("""&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#993300"&gt;Use your tools to answer this question. &lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="2" color="#993300"&gt;Step 1: Determine the data type. If the question is about user's personal information (like question pattern is 'My name is 'XXXX' or I am 'XXXX'), proceed to Step 2. If it is about general data, proceed to Step 4.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#993300"&gt;Step 2: Invoke the Fn_query_from_structured_data tool by passing the question mentioned in Step 6. Extract only sql and store the query in a variable named var_q.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#993300"&gt;Step 3: Invoke the Fn_executesql_from_structured_data tool, passing the SQL query stored in var_q as input. Execute the query and retrieve the result.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#993300"&gt;Step 4: If the question is about general data, invoke the Fn_query_from_unstructured_data tool to retrieve the answer.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#993300"&gt;Step 5: If any error occurs during the execution, stop immediately and report the error.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#993300"&gt;Step 6: Answer the question: My Name is Eric Ruiz. What are my yearly premium amount and sum insured amount?.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#993300"&gt;Please execute the steps sequentially and provide the final answer.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#993300"&gt;""")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#993300"&gt;print(response)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Sep 2024 08:39:47 GMT</pubDate>
      <guid>https://community.databricks.com/t5/generative-ai/how-to-deploy-an-agent-into-model-registry-using-mlflow/m-p/87172#M488</guid>
      <dc:creator>SandipCoder</dc:creator>
      <dc:date>2024-09-02T08:39:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to deploy an agent into model registry using MLFlow</title>
      <link>https://community.databricks.com/t5/generative-ai/how-to-deploy-an-agent-into-model-registry-using-mlflow/m-p/87176#M489</link>
      <description>&lt;P&gt;Had the same question when I was trying to deploy my custom llm. How we did it was wrapping it inside a custom mlflow model and registering it.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Sep 2024 08:49:54 GMT</pubDate>
      <guid>https://community.databricks.com/t5/generative-ai/how-to-deploy-an-agent-into-model-registry-using-mlflow/m-p/87176#M489</guid>
      <dc:creator>prar_shah</dc:creator>
      <dc:date>2024-09-02T08:49:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to deploy an agent into model registry using MLFlow</title>
      <link>https://community.databricks.com/t5/generative-ai/how-to-deploy-an-agent-into-model-registry-using-mlflow/m-p/114703#M827</link>
      <description>&lt;P&gt;Please go though this&amp;nbsp; :&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.databricks.com/aws/en/machine-learning/model-serving/custom-models" target="_blank"&gt;https://docs.databricks.com/aws/en/machine-learning/model-serving/custom-models&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Apr 2025 11:05:00 GMT</pubDate>
      <guid>https://community.databricks.com/t5/generative-ai/how-to-deploy-an-agent-into-model-registry-using-mlflow/m-p/114703#M827</guid>
      <dc:creator>SandipCoder</dc:creator>
      <dc:date>2025-04-07T11:05:00Z</dc:date>
    </item>
  </channel>
</rss>

