cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Generative AI
Explore discussions on generative artificial intelligence techniques and applications within the Databricks Community. Share ideas, challenges, and breakthroughs in this cutting-edge field.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Customizing the UI of Streamlit App Template

bryan1
New Contributor III

Hi There,

I used the Streamlit Chatbot template for Databricks Apps. I'm looking to customize the UI and wanted to make changes to the app.py file to do so. Even before I made any changes, I ran the file and I'm getting an error with databricks SDK and ChatMessage. 

I can't seem to find a solution to get the code to run so I can change the title of the chatbot and redeploy it. Any thoughts?

bryan1_0-1736647332600.png

 

7 REPLIES 7

Alberto_Umana
Databricks Employee
Databricks Employee

Hi @bryan1,

Could you please advise what SDK version are you using?

bryan1
New Contributor III

Hi Alberto,

I am on Version: 0.40.0 Databricks SDK for Python (Beta). Do you know what version has ChatMessage?

Alberto_Umana
Databricks Employee
Databricks Employee

Hi @bryan1,

I have just tested this sample code and worked for me on 0.40 SDK version, can you try it too?

 

from databricks.sdk.service.serving import ChatMessage

def test_chat_message():
message = ChatMessage(role="user", content="Hello, how can I help you today?")

print(f"Role: {message.role}")
print(f"Content: {message.content}")

assert message.role == "user"
assert message.content == "Hello, how can I help you today?"
test_chat_message()

bryan1
New Contributor III

Hi Alberto,

Still getting same error.

bryan1_0-1736783182337.png

 

Alberto_Umana
Databricks Employee
Databricks Employee

Hi @bryan1,

Thanks for the details, there might be something at the cluster level configuration, can you please share your cluster settings like DBR version / libraries / access mode?

I even tried on an older version / serverless and worked:

Alberto_Umana_0-1736783621106.png

 

bryan1
New Contributor III

Hi Alberto,

Here are the configs of the cluster, I have no libraries installed, and can manage the cluster for my permissions. 

bryan1_0-1736784116024.png

 

bryan1
New Contributor III

Hi Alberto,

Any thoughts on my last message around the cluster configurations? 

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group