def _create_event_from_template(
        self,
        event_id: str,
        record_id: str,
        app_name: str,
        app_version: str,
        app_id: str,
        start_timestamp: str,
        timestamp: str,
        span_type: str = "record_root",
        query: str = "What is the best coffee?",
        return_value: List[str] = None,
    ) -> Event:
        """Create an event by filling in a template span file.

        Args:
            event_id: Unique identifier for the event
            record_id: Record ID associated with the event
            app_name: Name of the app
            app_version: Version of the app
            app_id: ID of the app
            start_timestamp: Start timestamp of the event
            timestamp: End timestamp of the event
            span_type: Type of span (default: "record_root")
            query: Query text (default: "What is the best coffee?")
            return_value: List of return values (default: None)

        Returns:
            An Event object with the specified attributes
        """
        if return_value is None:
            return_value = ["Sample response"]

        # Load template file
        template_path = (
            Path(__file__).parent
            / "data"
            / "test_otel_spans"
            / "template_record_root_span.json"
        )
        with open(template_path, "r") as f:
            template = f.read()

        # Fill in template values
        event_data = (
            template.replace("{{event_id}}", event_id)
            .replace("{{app_name}}", app_name)
            .replace("{{app_version}}", app_version)
            .replace("{{app_id}}", app_id)
            .replace("{{query}}", query)
            .replace("{{return_value}}", json.dumps(return_value))
            .replace("{{record_id}}", record_id)
            .replace("{{span_type}}", span_type)
            .replace("{{start_timestamp}}", start_timestamp)
            .replace("{{timestamp}}", timestamp)
            .replace("{{span_id}}", f"span_{record_id}")
        )

        event = Event.model_validate(json.loads(event_data))
        return event
Create an event by filling in a template span file.

        Args:
            event_id: Unique identifier for the event
            record_id: Record ID associated with the event
            app_name: Name of the app
            app_version: Version of the app
            app_id: ID of the app
            start_timestamp: Start timestamp of the event
            timestamp: End timestamp of the event
            span_type: Type of span (default: "record_root")
            query: Query text (default: "What is the best coffee?")
            return_value: List of return values (default: None)

        Returns:
            An Event object with the specified attributes
        
tests/unit/test_otel_get_records_and_feedback.py