agents.conversation.directed.agent¶
Directed conversation agent where participants respond to mentions and direct questions. from typing import Any Uses structured output models for robust speaker selection and interaction tracking.
Classes¶
Directed conversation where agents respond to mentions and questions. |
|
Configuration for directed conversation behavior. |
|
Track interaction patterns between speakers. |
|
Types of mentions detected in messages. |
|
Structured representation of a speaker mention. |
|
Structured output for speaker selection logic. |
Module Contents¶
- class agents.conversation.directed.agent.DirectedConversation¶
Bases:
haive.agents.conversation.base.agent.BaseConversationAgent
Directed conversation where agents respond to mentions and questions.
Uses structured output models for robust speaker selection and tracking. Participants speak when: - They are directly mentioned (@name) - A question is directed at them - They haven’t spoken in a while (configurable)
- classmethod create_classroom(teacher_name='Teacher', student_names=None, topic="Today's lesson", config=None, **kwargs)¶
Create a classroom-style directed conversation.
- Parameters:
teacher_name (str) – Name of the teacher
topic (str) – Lesson topic
config (DirectedConversationConfig | None) – Optional configuration for directed conversation
**kwargs – Additional conversation arguments
- process_response(state)¶
Track interaction patterns using structured models.
- class agents.conversation.directed.agent.DirectedConversationConfig(/, **data)¶
Bases:
pydantic.BaseModel
Configuration for directed conversation behavior.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
data (Any)
- class agents.conversation.directed.agent.InteractionPattern(/, **data)¶
Bases:
pydantic.BaseModel
Track interaction patterns between speakers.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
data (Any)
- class agents.conversation.directed.agent.MentionType¶
-
Types of mentions detected in messages.
Initialize self. See help(type(self)) for accurate signature.
- class agents.conversation.directed.agent.SpeakerMention(/, **data)¶
Bases:
pydantic.BaseModel
Structured representation of a speaker mention.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
data (Any)
- class agents.conversation.directed.agent.SpeakerSelectionResult(/, **data)¶
Bases:
pydantic.BaseModel
Structured output for speaker selection logic.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- Parameters:
data (Any)