You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/sdialog/index.rst
+44-35Lines changed: 44 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -137,13 +137,24 @@ Now that we understand how to create dialogs, let's explore the powerful operati
137
137
138
138
Personas & Context
139
139
------------------
140
+
140
141
Personas are structured, typed attribute bundles that specify role, style, goals, background knowledge, and behavioral constraints used to condition LLM prompts for Agents in a reproducible, inspectable way. Context objects complement Personas with shared situational grounding so multiple agents can coordinate.
141
142
142
143
SDialog formalizes this socio-cognitive conditioning through attribute models:
Creates diverse character profiles with demographic, behavioral, and professional attributes. Ideal for generating varied participants in dialogue scenarios.
385
397
386
-
Let's see how we can create sophisticated doctor personas where attributes intelligently depend on each other. In this example, we'll make the communication style adapt based on years of experience:
398
+
Let's see how we can create sophisticated mentor personas where attributes intelligently depend on each other. In this example, we'll make the communication style adapt based on years of teaching experience:
387
399
388
400
.. code-block:: python
389
401
390
402
import random
391
-
from sdialog.personas importDoctor
403
+
from sdialog.personas importMentor
392
404
from sdialog.generators import PersonaGenerator
393
405
394
-
# Let's define a custom function to sample formality values based on experience
395
-
# Your function can take any of the persona attributes as keyword arguments
396
-
# In this case, we are interested in the years_of_experience attribute
Generates rich contextual frameworks that define the setting, environment, and situational constraints for dialogues. Essential for creating realistic and consistent conversation backgrounds.
427
436
428
-
Now let's create varied hospital contexts to set the stage for our medical conversations:
437
+
Now let's create varied classroom contexts to set the stage for our educational conversations:
Creates sophisticated dialogues by having two distinct personas or agents interact naturally. This generator produces more realistic and character-consistent conversations.
478
487
479
-
Here's how we can create a dialogue between a doctor and patient with their unique characteristics:
488
+
Here's how we can create a dialogue between a mentor and student with their unique characteristics:
480
489
481
490
.. code-block:: python
482
491
483
-
from sdialog.personas importDoctor, Patient
492
+
from sdialog.personas importMentor, Student
484
493
from sdialog.generators import PersonaDialogGenerator
0 commit comments