Cezik
Cezik
SSolara
Created by Cezik on 8/15/2024 in #general
Hello,
Great idea! I think this will definitely help users coming into the framework
21 replies
SSolara
Created by Cezik on 8/15/2024 in #general
Hello,
Oh, thank you so much! ❤️ The example is great and I think it would be useful to have an identical one in the documentation, it illustrates very well what I wanted to achieve 🫂
21 replies
SSolara
Created by Cezik on 8/15/2024 in #general
Hello,
@MaartenBreddels Sorry to bother you (I know you're probably busy with other things), but do you have any information about catching events with pyvuetify or could you provide some resources where this is explained? I would appreciate any information 🤗
21 replies
SSolara
Created by Cezik on 8/9/2024 in #questions-issues
Thread vs Task
I think it would help. From the perspective of a person who doesn't necessarily come from a python background (I'm guessing there are quite a few such users): I see two functions that look quite similar at first glance + use_task has the ability to set a prefer_threaded parameter, which further adds to the misunderstanding. In this case, I would most appreciate a comparison of the two functions with an example that would illustrate a use case where use_task would work better instead of use_thread and vice versa. Additionally, information about potential substitution would suggest to me to use use_task.
5 replies
SSolara
Created by Cezik on 8/15/2024 in #general
Hello,
Ideally, a specific function should be called when a TextArea (readonly component from pyvuetify) is clicked. What is the feature based on? I have a TextArea component in the application, the contents of which will be filled by an AI agent (in a nutshell, it's just LLM) that runs in a separate task (use_task). Once this field is filled with the entire message, I would like the user to be able to click on the TextArea component and, the contents will be copied to the clipboard. The copying itself from the variable storing the contents of the field I already have implemented using the clipboard library, so I would only care to hook the event of clicking on TextArea to some function
21 replies
SSolara
Created by Cezik on 8/15/2024 in #general
Hello,
By the way, I'll ask - is it possible to tap into the event triggered by pyvuetify? I'm using the TextArea component from reacton.pyvuetify and would like to copy its contents to the clipboard on click
21 replies
SSolara
Created by Cezik on 8/15/2024 in #general
Hello,
I found the cause... It was my fault. It turned out that the username has a broadcast class “message-name”, and I use an identical class in a different context (in a different part of the GUI) and this class has a display: none setting.... Sorry for the confusion, but it was my fault - the names of the various css classes overlapped
21 replies
SSolara
Created by Cezik on 8/15/2024 in #general
Hello,
Sorry, but earlier the link I provided took you to the default template on pycafe. Here is a link to an example from the documentation and it works fine (displays the username with each message), however in the local environment with this code I provided the name does not display. Even the example that is in the link does not show the username correctly. I am working on macOS Sonoma 14.5 with python 3.12.2 and solara 1.37.1. https://py.cafe/CezikLikeWhat/solara-example-chat-message
21 replies
SSolara
Created by Cezik on 8/15/2024 in #general
Hello,
Hey @MaartenBreddels , do you have any new news what this could be caused by?
21 replies
SSolara
Created by Cezik on 8/15/2024 in #general
Hello,
No description
21 replies
SSolara
Created by Cezik on 8/15/2024 in #general
Hello,
Hello, sorry for the late reply, but I was not at the computer. Sure enough, I have provided a link to pycafe (this is an example from the documentation under the heading “A Basic Example”). EDIT: It looks like the default template opens when you click on the link, so I'm inserting a screenshot from pycafe
21 replies
SSolara
Created by Cezik on 8/5/2024 in #questions-issues
Solara Error
I solved the problem! Below I paste the solution should anyone ever run into a similar problem:
@solara.component
def Page():
openai_api_key_value = solara.reactive('')
show_error = solara.reactive('')

def validate_form() -> bool:
try:
raise InvalidSetting.invalid_api_key('test', 'message')
except InvalidSetting as e:
show_error.set(str(e))
return False

return True

def submit_form():
if validate_form():
solara.Success(label='Saved')

# View
header.Header('Settings')
sidebar.Sidebar('Settings')

with solara.Column(margin=10):
Title('AI 🧬')

SubTitle('OpenAI')
solara.InputText(
label='OpenAI API Key',
value=openai_api_key_value
)

if show_error.value:
solara.Error(label=show_error.value)

with solara.Column(align='end'):
solara.Button(
'Submit',
on_click=submit_form,
outlined=True,
color='primary'
)
@solara.component
def Page():
openai_api_key_value = solara.reactive('')
show_error = solara.reactive('')

def validate_form() -> bool:
try:
raise InvalidSetting.invalid_api_key('test', 'message')
except InvalidSetting as e:
show_error.set(str(e))
return False

return True

def submit_form():
if validate_form():
solara.Success(label='Saved')

# View
header.Header('Settings')
sidebar.Sidebar('Settings')

with solara.Column(margin=10):
Title('AI 🧬')

SubTitle('OpenAI')
solara.InputText(
label='OpenAI API Key',
value=openai_api_key_value
)

if show_error.value:
solara.Error(label=show_error.value)

with solara.Column(align='end'):
solara.Button(
'Submit',
on_click=submit_form,
outlined=True,
color='primary'
)
2 replies