def chat_stream_generation_info(self, event_data: Dict) -> Dict[str, Any]:
        """Extract generation info from a streaming chat response."""
        generation_info: Dict[str, Any] = {
            "finish_reason": event_data.get("finishReason"),
            "documents": event_data.get("documents", []),
            "citations": event_data.get("citations", []),
            "search_queries": event_data.get("searchQueries", []),
            "is_search_required": event_data.get("isSearchRequired", False),
        }

        # Handle tool calls if present
        if "toolCalls" in event_data:
            generation_info["tool_calls"] = _format_oci_tool_calls(
                event_data["toolCalls"]
            )

        return {k: v for k, v in generation_info.items() if v is not None}
Extract generation info from a streaming chat response.
llama-index-integrations/llms/llama-index-llms-oci-genai/llama_index/llms/oci_genai/utils.py