haive.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 haive.agents.conversation.directed.agent.DirectedConversation¶
Bases:
haive.agents.conversation.base.agent.BaseConversationAgentDirected 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.
- Parameters:
state (haive.agents.conversation.directed.state.DirectedState)
- Return type:
langgraph.types.Command
- select_speaker(state)¶
Select speaker based on mentions and context using structured models.
- Parameters:
state (haive.agents.conversation.directed.state.DirectedState)
- Return type:
langgraph.types.Command
- class haive.agents.conversation.directed.agent.DirectedConversationConfig(/, **data)¶
Bases:
pydantic.BaseModelConfiguration 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 haive.agents.conversation.directed.agent.InteractionPattern(/, **data)¶
Bases:
pydantic.BaseModelTrack 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 haive.agents.conversation.directed.agent.MentionType¶
-
Types of mentions detected in messages.
Initialize self. See help(type(self)) for accurate signature.
- class haive.agents.conversation.directed.agent.SpeakerMention(/, **data)¶
Bases:
pydantic.BaseModelStructured 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 haive.agents.conversation.directed.agent.SpeakerSelectionResult(/, **data)¶
Bases:
pydantic.BaseModelStructured 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)