Skip to content

Commit 449a5da

Browse files
Enhance dialogue examples in tutorial 2
1 parent 07245d2 commit 449a5da

3 files changed

Lines changed: 27 additions & 19 deletions

File tree

src/sdialog/datasets.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -435,12 +435,8 @@ def get_system_persona_for_scenario(scenario):
435435
:return: System persona object.
436436
:rtype: Persona
437437
"""
438-
dialogue_details = f"""In the conversation, the AI assistant is instructed to follow specific action flowcharts to address the tasks. Flowcharts are defined as graph described using DOT.
439-
The actual DOT for the current tasks are:
440-
{STAR.get_flowchart_description_for_scenario(scenario)}
441-
""" # noqa: E501
442438
return Persona(
443-
role="AI assistant.\n" + dialogue_details,
439+
role="AI assistant.",
444440
circumstances=scenario["WizardTask"],
445441
)
446442

@@ -458,7 +454,13 @@ def get_agents_for_scenario(scenario, model_name: str = None):
458454
"""
459455
user = Agent(STAR.get_user_persona_for_scenario(scenario), name="User", model=model_name, can_finish=True)
460456

461-
system = Agent(STAR.get_system_persona_for_scenario(scenario), name="System", model=model_name)
457+
system = Agent(STAR.get_system_persona_for_scenario(scenario),
458+
name="System",
459+
dialogue_details=f"""In the conversation, the AI assistant is instructed to follow specific action flowcharts to address the tasks. Flowcharts are defined as graph described using DOT.
460+
The actual DOT for the current tasks are:
461+
{STAR.get_flowchart_description_for_scenario(scenario)}
462+
""", # noqa: E501
463+
model=model_name)
462464

463465
return system, user
464466

src/sdialog/personas.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class Persona(BasePersona):
4545
"""
4646

4747
name: str = Field("", description="Name of the persona.")
48-
age: Union[int, str] = Field(None, description="Age (integer or descriptive string like 'middle-aged').")
48+
age: Union[int, str] = Field("", description="Age (integer or descriptive string like 'middle-aged').")
4949
race: str = Field("", description="Race or ethnicity.")
5050
gender: str = Field("", description="Gender of the persona.")
5151
language: str = Field("English", description="Preferred language of communication.")

tutorials/00_overview/2.multi-agent_generation.ipynb

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -930,23 +930,29 @@
930930
"name": "stdout",
931931
"output_type": "stream",
932932
"text": [
933-
"\u001b[1m\u001b[95m[dialog_id] \u001b[35m151fbd58-f851-4625-b9cb-39bbd6c18a94\u001b[0m\n",
933+
"\u001b[1m\u001b[95m[dialog_id] \u001b[35m455dd48c-43f2-4cb9-b5d8-96e6f5904f38\u001b[0m\n",
934934
"\u001b[1m\u001b[95m[complete] \u001b[35mTrue\u001b[0m\n",
935-
"\u001b[1m\u001b[95m[model] \u001b[35m{'name': 'ollama:gemma3:12b', 'seed': 13, 'temperature': 1, 'top_k': 64, 'top_p': 0.95}\u001b[0m\n",
936-
"\u001b[1m\u001b[95m[seed] \u001b[35m2728834303\u001b[0m\n",
935+
"\u001b[1m\u001b[95m[model] \u001b[35m{'name': 'ollama:qwen2.5:32b', 'seed': 13, 'temperature': 0.8}\u001b[0m\n",
936+
"\u001b[1m\u001b[95m[seed] \u001b[35m3791554011\u001b[0m\n",
937937
"\u001b[1m\u001b[35m--- Dialogue Begins ---\u001b[0m\n",
938938
"\u001b[31m[System] \u001b[0mHello, how can I help?\u001b[0m\n",
939-
"\u001b[94m[User] \u001b[0mHi, I need to book a flight and check the weather, please.\u001b[0m\n",
940-
"\u001b[31m[System] \u001b[0mMay I have your name, please?\u001b[0m\n",
941-
"\u001b[94m[User] \u001b[0mIt’s Ben.\u001b[0m\n",
942-
"\u001b[31m[System] \u001b[0mMay I have your name, please?\u001b[0m\n",
943-
"\u001b[94m[User] \u001b[0mBen, as I said. Look, let’s just get this flight sorted first, okay?\u001b[0m\n",
944-
"\u001b[31m[System] \u001b[0mMay I have your name, please?\u001b[0m\n",
945-
"\u001b[94m[User] \u001b[0mSeriously? It's Ben! Can we just focus on finding a flight from Chicago to Pittsburgh?\u001b[0m\n",
939+
"\u001b[94m[User] \u001b[0mHey there! Could you help me find a flight from Chicago to Pittsburgh please? And maybe check the weather in both cities too?\u001b[0m\n",
946940
"\u001b[31m[System] \u001b[0mMay I have your name, please?\u001b[0m\n",
947-
"\u001b[94m[User] \u001b[0mOh for crying out loud! It's Ben! Are you even listening? I need a flight, Chicago to Pittsburgh!\u001b[0m\n",
941+
"\u001b[94m[User] \u001b[0mOh sure, my name is Ben. Can you start with finding that flight for me, Ben?\u001b[0m\n",
942+
"\u001b[31m[System] \u001b[0mWhere are you departing from?\u001b[0m\n",
943+
"\u001b[94m[User] \u001b[0mI'm departing from Chicago. Could you focus on flights leaving in the next few days? Oh, and could you also tell me what the weather's like there right now?\u001b[0m\n",
944+
"\u001b[31m[System] \u001b[0mWhere are you going to?\u001b[0m\n",
945+
"\u001b[94m[User] \u001b[0mI'm going to Pittsburgh. Can we look at both the flight options and the current weather in Chicago first though? Thanks!\u001b[0m\n",
946+
"\u001b[31m[System] \u001b[0mOn what day do you want the plane to arrive? I'll also check the current weather for Chicago right now.\u001b[0m\n",
947+
"\u001b[94m[User] \u001b[0mHow about next Thursday? And yeah, the weather in Chicago would be great to know. It just started pouring here all of a sudden, which is why I'm asking.\u001b[0m\n",
948+
"\u001b[31m[System] \u001b[0mRight, I found a United Airlines flight for $300 that takes 2 hours to get to Pittsburgh on next Thursday. As for the current weather in Chicago, it's raining heavily with temperatures around 15 degrees Celsius. Would you like to search for any more flights or do anything else?\u001b[0m\n",
949+
"\u001b[94m[User] \u001b[0mThe flight sounds good, can you book it for me please? And could you also check the weather forecast for Pittsburgh on Thursday when I land? Thanks!\u001b[0m\n",
948950
"\u001b[31m[System] \u001b[0mMay I have your name, please?\u001b[0m\n",
949-
"\u001b[94m[User] \u001b[0mYou know what? Forget it. I’m doing this myself.\u001b[0m\n",
951+
"\u001b[94m[User] \u001b[0mI already gave my name, it's Ben. Can we just proceed with booking this flight and checking the weather in Pittsburgh?\u001b[0m\n",
952+
"\u001b[31m[System] \u001b[0mThe flight is available. Should I reserve it for you, Ben?\u001b[0m\n",
953+
"\u001b[94m[User] \u001b[0mYes, go ahead and book it. And one more thing, could you check what the weather will be like in Pittsburgh on Thursday when I land? Thanks a lot!\u001b[0m\n",
954+
"\u001b[31m[System] \u001b[0mRight, your flight is now reserved! Let me check the weather forecast for Pittsburgh on Thursday. It will be cloudy all day on Thursday in Pittsburgh, with temperatures of around 18 degrees Celsius. Is there anything else that I can do for you?\u001b[0m\n",
955+
"\u001b[94m[User] \u001b[0mGreat, thanks for checking that. Everything looks good, so no need for anything else right now. Appreciate your help! Goodbye!\u001b[0m\n",
950956
"\u001b[31m[System] \u001b[0mThank you and goodbye!\u001b[0m\n",
951957
"\u001b[1m\u001b[35m--- Dialogue Ends ---\u001b[0m\n"
952958
]

0 commit comments

Comments
 (0)