Repository: emcie-co/parlant
File: src/parlant/core/engines/alpha/engine.py (Python)

Code before:
                "status": "acknowledged",
                "data": {},
            },
        )

        try:
            context_variables = await self._load_context_variables(
                agent_id=context.agent_id, session=session, customer=customer
            )

            terms = set(
                await self._load_relevant_terms(
                    agents=[agent],
                    context_variables=context_variables,
                )
            )

            ordinary_guideline_propositions = await self._utter_requests_to_guideline_propositions(
                actions
            )

            await event_emitter.emit_status_event(
                correlation_id=self._correlator.correlation_id,
                data={
                    "acknowledged_offset": interaction.last_known_event_offset,
                    "status": "processing",
                    "data": {},
                },
            )

            message_generation_inspections = []

            for event_generation_result in await self._message_event_generator.generate_events(
                event_emitter=event_emitter,
                agents=[agent],
                customer=customer,
                context_variables=context_variables,
                interaction_history=[],
                terms=list(terms),
                ordinary_guideline_propositions=ordinary_guideline_propositions,
                tool_enabled_guideline_propositions={},
                staged_events=[],
            ):
                message_generation_inspections.append(
                    MessageGenerationInspection(
                        generation=event_generation_result.generation_info,
                        messages=[
                            e.data["message"]
                            if e and e.kind == "message" and isinstance(e.data, dict)
                            else None
                            for e in event_generation_result.events

Review comment (suggestion):
Status type here should be "typing" not "processing", since we are literally just typing a message and not running any tools or fetching guidelines.

Code after:
                "status": "acknowledged",
                "data": {},
            },
        )

        try:
            context_variables = await self._load_context_variables(
                agent_id=context.agent_id, session=session, customer=customer
            )

            terms = set(
                await self._load_relevant_terms(
                    agents=[agent],
                    context_variables=context_variables,
                )
            )

            ordinary_guideline_propositions = await self._utter_requests_to_guideline_propositions(
                requests
            )

            await event_emitter.emit_status_event(
                correlation_id=self._correlator.correlation_id,
                data={
                    "acknowledged_offset": interaction.last_known_event_offset,
                    "status": "typing",
                    "data": {},
                },
            )

            message_generation_inspections = []

            for event_generation_result in await self._message_event_generator.generate_events(
                event_emitter=event_emitter,
                agents=[agent],
                customer=customer,
                context_variables=context_variables,
                interaction_history=[],
                terms=list(terms),
                ordinary_guideline_propositions=ordinary_guideline_propositions,
                tool_enabled_guideline_propositions={},
                staged_events=[],
            ):
                message_generation_inspections.append(
                    MessageGenerationInspection(
                        generation=event_generation_result.generation_info,
                        messages=[
                            e.data["message"]
                            if e and e.kind == "message" and isinstance(e.data, dict)
                            else None
                            for e in event_generation_result.events