<?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: Error when querying RAG serving endpoint in Generative AI</title>
    <link>https://community.databricks.com/t5/generative-ai/error-when-querying-rag-serving-endpoint/m-p/120840#M930</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/154481"&gt;@Shua42&lt;/a&gt;&amp;nbsp;thanks for getting back to me!&lt;/P&gt;&lt;P&gt;It seems that for ChatDatabricks, it does not expect a dictionary, it's expecting an array of tuples, so doing the above gave me an error.&lt;/P&gt;&lt;P&gt;When I use your message format in connecting via API, that works.&amp;nbsp; But it's just for this ChatDatabricks where I am struggling.&lt;/P&gt;</description>
    <pubDate>Tue, 03 Jun 2025 17:13:15 GMT</pubDate>
    <dc:creator>mark_goodwin</dc:creator>
    <dc:date>2025-06-03T17:13:15Z</dc:date>
    <item>
      <title>Error when querying RAG serving endpoint</title>
      <link>https://community.databricks.com/t5/generative-ai/error-when-querying-rag-serving-endpoint/m-p/120332#M910</link>
      <description>&lt;P&gt;I built a RAG by cloning the databricks example (create a vector search index of databricks documentation and then a RAG).&lt;/P&gt;&lt;P&gt;When I try and call the RAG via the serving endpoint from a notebook, I get the following error:&lt;/P&gt;&lt;P&gt;dictionary update sequence element #0 has length 309; 2 is required&lt;/P&gt;&lt;P&gt;I can't figure out what I've done wrong.&amp;nbsp; When I use the Serving interface in databricks and ask it a question, it works fine.&amp;nbsp; Here's my code:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;chat_model = ChatDatabricks(
    endpoint="my_rag",
    temperature=0.1,
    max_tokens=256,

messages = [
    ("user", "What questions can I ask?"),
]
chat_model.invoke(messages)&lt;/LI-CODE&gt;&lt;P&gt;Any tips or hints on what my problem is I would be grateful!&amp;nbsp; Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 27 May 2025 14:55:24 GMT</pubDate>
      <guid>https://community.databricks.com/t5/generative-ai/error-when-querying-rag-serving-endpoint/m-p/120332#M910</guid>
      <dc:creator>mark_goodwin</dc:creator>
      <dc:date>2025-05-27T14:55:24Z</dc:date>
    </item>
    <item>
      <title>Re: Error when querying RAG serving endpoint</title>
      <link>https://community.databricks.com/t5/generative-ai/error-when-querying-rag-serving-endpoint/m-p/120335#M911</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/166118"&gt;@mark_goodwin&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I believe this has to do with the formatting of the messages. In the serving UI, the formatting is abstracted out for you, but you may need to format it as a list of dictionaries for the invoke() call, such as:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;messages = [
    {"role": "user", "content": "What questions can I ask?"}
]&lt;/LI-CODE&gt;
&lt;P&gt;Try that out and let me know if it yields any different results.&lt;/P&gt;</description>
      <pubDate>Tue, 27 May 2025 15:19:06 GMT</pubDate>
      <guid>https://community.databricks.com/t5/generative-ai/error-when-querying-rag-serving-endpoint/m-p/120335#M911</guid>
      <dc:creator>Shua42</dc:creator>
      <dc:date>2025-05-27T15:19:06Z</dc:date>
    </item>
    <item>
      <title>Re: Error when querying RAG serving endpoint</title>
      <link>https://community.databricks.com/t5/generative-ai/error-when-querying-rag-serving-endpoint/m-p/120840#M930</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/154481"&gt;@Shua42&lt;/a&gt;&amp;nbsp;thanks for getting back to me!&lt;/P&gt;&lt;P&gt;It seems that for ChatDatabricks, it does not expect a dictionary, it's expecting an array of tuples, so doing the above gave me an error.&lt;/P&gt;&lt;P&gt;When I use your message format in connecting via API, that works.&amp;nbsp; But it's just for this ChatDatabricks where I am struggling.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jun 2025 17:13:15 GMT</pubDate>
      <guid>https://community.databricks.com/t5/generative-ai/error-when-querying-rag-serving-endpoint/m-p/120840#M930</guid>
      <dc:creator>mark_goodwin</dc:creator>
      <dc:date>2025-06-03T17:13:15Z</dc:date>
    </item>
  </channel>
</rss>

