Skip to content

Commit 21e496f

Browse files
authored
fix: camel app AttributeError (camel-ai#1439)
1 parent 6bc9c05 commit 21e496f

File tree

2 files changed

+26
-24
lines changed

2 files changed

+26
-24
lines changed

apps/agents/agents.py

+26-23
Original file line numberDiff line numberDiff line change
@@ -563,37 +563,40 @@ def change_society(society_name: str) -> Tuple[Dict, Dict, str]:
563563
lambda v: gr.update(visible=v), task_specifier_cb, ts_word_limit_nb
564564
)
565565

566+
def start_chain():
567+
state = cleanup_on_launch(session_state.value)
568+
state, specified_task, task_prompt, chat, progress = (
569+
role_playing_start(
570+
state,
571+
society_dd.value,
572+
assistant_ta.value,
573+
user_ta.value,
574+
original_task_ta.value,
575+
num_messages_sl.value,
576+
task_specifier_cb.value,
577+
ts_word_limit_nb.value,
578+
language_ta.value,
579+
)
580+
)
581+
state, chat, progress = role_playing_chat_init(state)
582+
return (
583+
state,
584+
specified_task,
585+
task_prompt,
586+
chat,
587+
progress,
588+
)
589+
566590
start_bn.click(
567-
cleanup_on_launch,
568-
session_state,
569-
[session_state, chatbot, start_bn],
570-
queue=False,
571-
).then(
572-
role_playing_start,
573-
[
574-
session_state,
575-
society_dd,
576-
assistant_ta,
577-
user_ta,
578-
original_task_ta,
579-
num_messages_sl,
580-
task_specifier_cb,
581-
ts_word_limit_nb,
582-
language_ta,
583-
],
584-
[
591+
fn=start_chain,
592+
outputs=[
585593
session_state,
586594
specified_task_ta,
587595
task_prompt_ta,
588596
chatbot,
589597
progress_sl,
590598
],
591599
queue=False,
592-
).then(
593-
role_playing_chat_init,
594-
session_state,
595-
[session_state, chatbot, progress_sl],
596-
queue=False,
597600
)
598601

599602
blocks.load(

apps/agents/test/test_agents.py

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
)
2727

2828

29-
@pytest.mark.skip(reason="Skipping this test temporarily")
3029
def test_construct_blocks():
3130
blocks = construct_blocks(None)
3231
assert isinstance(blocks, gr.Blocks)

0 commit comments

Comments
 (0)