haive.agents.conversation.directed.agent ======================================== .. py:module:: haive.agents.conversation.directed.agent .. autoapi-nested-parse:: 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 ------- .. autoapisummary:: haive.agents.conversation.directed.agent.DirectedConversation haive.agents.conversation.directed.agent.DirectedConversationConfig haive.agents.conversation.directed.agent.InteractionPattern haive.agents.conversation.directed.agent.MentionType haive.agents.conversation.directed.agent.SpeakerMention haive.agents.conversation.directed.agent.SpeakerSelectionResult Module Contents --------------- .. py:class:: DirectedConversation Bases: :py:obj:`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) .. py:method:: create_classroom(teacher_name = 'Teacher', student_names = None, topic = "Today's lesson", config = None, **kwargs) :classmethod: Create a classroom-style directed conversation. :param teacher_name: Name of the teacher :param student_names: List of student names :param topic: Lesson topic :param config: Optional configuration for directed conversation :param \*\*kwargs: Additional conversation arguments .. py:method:: get_conversation_state_schema() Use extended state schema. .. py:method:: process_response(state) Track interaction patterns using structured models. .. py:method:: select_speaker(state) Select speaker based on mentions and context using structured models. .. py:class:: DirectedConversationConfig(/, **data) Bases: :py:obj:`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. .. py:class:: InteractionPattern(/, **data) Bases: :py:obj:`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. .. py:class:: MentionType Bases: :py:obj:`str`, :py:obj:`enum.Enum` Types of mentions detected in messages. Initialize self. See help(type(self)) for accurate signature. .. py:class:: SpeakerMention(/, **data) Bases: :py:obj:`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. .. py:class:: SpeakerSelectionResult(/, **data) Bases: :py:obj:`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.