Cezik
Cezik
SSolara
Created by Cezik on 8/9/2024 in #questions-issues
Thread vs Task
Hey 👋 , I would like to implement chat using CrewAI and I am wondering what is the difference between use_thread and use_task. I haven't found a clear comparison in the documentation, so I'm asking if anyone would be able to explain to me the differences or give me some example use cases? For any answer I will be grateful 🫂
5 replies
SSolara
Created by Cezik on 8/5/2024 in #questions-issues
Solara Error
Hey 👋 , I have encountered a problem that I have not found in Github issues or on discord. I created a page that has a form with a dozen fields (select, input, slider) and a button at the very bottom of the page. When it is clicked, these fields are validated (that the values are not empty, etc.) and during if an exception is thrown I run solara.Error(label='message') however it is not visible anywhere (I am sure it goes into the except block in try except). I paste the simplified code below. Any help would be appreciated! 🫂
@solara.component
def Page():
openai_api_key_value = solara.reactive('')

def validate_form() -> bool:
try:
raise InvalidSetting.invalid_api_key('test', 'message')
except InvalidSetting as e:
print('test_print')
solara.Error(label='error during validation')
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
)

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('')

def validate_form() -> bool:
try:
raise InvalidSetting.invalid_api_key('test', 'message')
except InvalidSetting as e:
print('test_print')
solara.Error(label='error during validation')
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
)

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